[CODE] abbrev snippet

From: Shaun Bourque (GraspCHAOS@aol.com)
Date: 05/25/99


anyone familiar with this code from Mouse under Abbreviations [by Zigg]:

In 'handler.c', change isname() to this:

#define WHITESPACE " \t"

int isname(char *str, char *namelist)
{
  char *newlist;
  char *curtok;

  newlist = strdup(namelist); /* make a copy since strtok 'modifies' strings
*/

  for(curtok = strtok(newlist, WHITESPACE); curtok; curtok = strtok(NULL,


WHITESPACE))
     if(curtok && is_abbrev(str, curtok))
     {
        free(newlist);
        return 1;
     }
  free(newlist);
  return 0;
}

it says "This will check for an abbreviation on every word in the namelist."
but it doesnt. i was wondering if i'm not seeing something correctly or if i
need to add something to it to make it work? as this code stands if a
mob's/objs namelist/aliaslist is freaky monkey mob, if you try to kill monkey
or mob it says they arent here, but it does indeed allow a player to type
kill frea and attack the mob, only if you try to abbrev the first word in the
namelist. if anyone could enlighten me i would appreciate it


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST