Login
User Name:

Password:



Register

Forgot your password?
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
AhrefsBot, Google, Bing

Members: 0
Guests: 20
Stats
Files
Topics
Posts
Members
Newest Member
488
3,788
19,631
595
Khonsu

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Bugfix Lists » AFKMud Bugfix List » [Bug:Helps] Help file keyword...
Forum Rules | Mark all | Recent Posts

[Bug:Helps] Help file keywords are case sensitive.
< Newer Topic :: Older Topic > AFKMud 2.1.3

Pages:<< prev 1 next >>
Post is unread #1 Mar 7, 2010 9:03 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,685
JoinedJan 1, 2002

 
Bug: Help file keywords are case sensitive.
Danger: Trivial - Case sensitivity is annoying, not dangerous.
Discovered in: AFKMud 2.1.3
Found by: tphegley, Quixadhal, and others
Fixed by: Quixadhal

---

help.cpp

Locate:
#include 


Below that, add:
#include 


help.cpp, load_helps

Locate:
      else if( key == "Keywords" )
      {
         stream.getline( buf, MSL );
         value = buf;
         strip_lspace( value );
         help->keyword = value;
      }


Change to:
      else if( key == "Keywords" )
      {
         stream.getline( buf, MSL );
         value = buf;
         strip_lspace( value );
         std::transform(value.begin(), value.end(), value.begin(), (int(*)(int)) toupper);
         help->keyword = value;
      }


help.cpp, get_help

Locate:
   while( !argument.empty(  ) )
   {
      argument = one_argument( argument, argone );
      if( !argall.empty(  ) )
         argall.append( 1, ' ' );
      argall.append( argone );
   }


Change to:
   while( !argument.empty(  ) )
   {
      argument = one_argument( argument, argone );
      if( !argall.empty(  ) )
         argall.append( 1, ' ' );
      argall.append( argone );
   }
   std::transform(argall.begin(), argall.end(), argall.begin(), (int(*)(int)) toupper);


Largely an annoyance, but during the conversion to std::string help file keywords lost their case-insensitivity due to how the code handles checking to see if the keywords entered by the user are part of a particular entry's list. This quick fix by Quixhadhal should solve the issue by forcing all help keywords into upper case as was the Smaug standard.

Pages:<< prev 1 next >>