Pages:<< prev 1 next >>
#1 Mar 7, 2010 9:03 pm
Black Hand
GroupAdministrators
Posts3,697
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:
Below that, add:
help.cpp, load_helps
Locate:
Change to:
help.cpp, get_help
Locate:
Change to:
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.
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 >>