Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Bing, Yahoo!, DotBot, Sogou

Members: 0
Guests: 4
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » 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, 7:03 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
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 <fstream>


Below that, add:
#include <algorithm>


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 >>