Re: 2.1.120pre2: Bug in strnicmp() noted in 2.1.119pre1 is still there!

Michael O'Reilly (michael@metal.iinet.net.au)
31 Aug 1998 15:31:02 +0800


Horst von Brand <vonbrand@sleipnir.valparaiso.cl> writes:
> [Bcc:d to linux-patches@samba.anu.edu.au]
> It makes no sense to compare tolower(*s1) to tolower(*s2) all over the
> place and then to just forget about that and compare the raw characters for
> the result...
>
> --- linux/fs/isofs/inode.c.dist-2.1.120-2 Sun Aug 30 21:17:05 1998
> +++ linux/fs/isofs/inode.c Sun Aug 30 21:20:32 1998
> @@ -137,7 +137,7 @@
> }
> if (*s1 == 0 && *s2 == 0) return 0;
> if (*s1 && *s2) {
> - if (*s1 > *s2) return 1;
> + if (tolower(*s1) > tolower(*s2)) return 1;
> return -1;
> }
> if (*s1) return 1;
>
> Now compiling 2.1.120pre2 (with the above patch).

Well, if you're going to do that, you also need to change the equality
line above to be:
if (tolower(*s1) == tolower(*s2)) return 0;

Michael.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html