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  -   | Genius may have its limitations, but stupidity | is not thus handicapped. -- Elbert Hubbard

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

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