Re: [ Code ] search_block

From: George (greerga@DRAGON.HAM.MUOHIO.EDU)
Date: 11/10/97


On Mon, 10 Nov 1997, David Klasinc wrote:

>is this search_block() (in interpreter.c) broken only with me? if you're
>searching in the array of the uppercase strings it alwasy returns -1...
>*scratch* Weird... *ponder*

int search_block(char *arg, char **list, int exact)
{
  register int i, l;

  /* Make into lower case, and get length of string */
  for (l = 0; *(arg + l); l++)
    *(arg + l) = LOWER(*(arg + l));

You'll never match uppercase because it uses 'strcmp' and 'strncmp' for
case sensitivity.  I'm thinking they should be str_cmp and strn_cmp, almost
everything else in the mud is case insensitive.

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


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



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