Re: [CODE] Command abbreviations

From: Dana Luther (
Date: 09/01/00

-----Original Message-----
From: Torgny Bjers <>


>What causes the abbreviations to be trapped is the isname, right?  Or so I
>would assume by looking at the code.  Well, here is my isname:
>int isname(const char *str, const char *namelist)
>  char *newlist;
>  char *curtok;
>  newlist = strdup(namelist); /* make a copy since strtok 'modifies'
>  for(curtok = strtok(newlist, WHITESPACE); curtok; curtok = strtok(NULL,
>     if(curtok && is_abbrev(str, curtok))          <----- this is the line
>     {
>        free(newlist);
>        return 1;
>     }
>  free(newlist);
>  return 0;

Yes, it's your isname. Notice the line which reads is_abbrev(str, curtok).
Now you get to choose - You can change your isname so that you can't use the
abbreviations (which would affect everthing and is not the best idea in my
opinion), or you can use an alternate isname for your help related functions
(namely the find_help and the function in the hedit which calls isname() to
decide which help entry to edit).
In the hedit patch was a copy of the original isname. What I did was copy
that in as orig_isname and use that instead of isname() in the hedit and
find_help. This enables you to have your abbreviated name search
capabilities for everything else, and use exact name comparison for your
help files.

Maybe not the best solution, but it certainly does work. ;)


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 04/11/01 PDT