[1461] in Athena Bugs
6.0R attach bug -- cistrcmp
daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Fri Dec 2 08:01:33 1988
Date: Fri, 2 Dec 88 08:01:11 EST
From: Jonathan I. Kamens <jik@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
Cc: rfrench@ATHENA.MIT.EDU
There is a very subtle bug in the current version of attach, relating
to the function cistrcmp, a case-insensitive string comparison which
was, presumably, written before strcasecmp. The bug is known by Rob
French, but I don't know if he's gotten around to fixing it yet... the
fix is simple, since all you have to do is delete cistrcmp and replace
all references to it with strcasecmp.
I've done that, to simplify things. Here is the patchfile.
*************************
diff -r /source/4.3/bin.athena/attach/util.c /tmp/attach/util.c
150c150
< if (!cistrcmp(fstypes[i].fs, s))
---
> if (!strcasecmp(fstypes[i].fs, s))
281c281
< if (!cistrcmp(at.host, name)) {
---
> if (!strcasecmp(at.host, name)) {
885,901c885
< return (cistrcmp(at->hesiodname, s));
< }
<
< /*
< * Case independent string comparison
< */
<
< cistrcmp(s1, s2)
< char *s1;
< char *s2;
< {
< while (_toupper(*s1) == _toupper(*s2)) {
< s2++;
< if (!*s1++)
< return (0);
< }
< return (_toupper(*s1) - _toupper(*--s2));
---
> return (strcasecmp(at->hesiodname, s));