once again having to add xemacs-beta manually to the cc list ...
Martin Buchholz wrote:
>>>>> "Ben" == Ben Wing <ben(a)666.com> writes:
Ben> please let's not do this.
Ben> strcasecmp[] is already defined in sysdep.c. let's just give it a different
Ben> name and use it, instead of messing up the code like this.
If we have our own version of strcasecmp, it shouldn't be in sysdep.c,
since we are defining our own version *unconditionally*. I don't
really want to create a new file just for ascii_strcasecmp.
So where to put it?
in my mule ws is a new file text.c, where i pulled out lots of junk scattered
across various other files. it should go here.
Ben> btw strcasecmp[] is used in other files, too.
Yes, lwlib.
Also mswin.
Where to put the definition? For this particular case, I
recommend code duplication.
agreed.
lwlib.c i think.
static int
ascii_strcasecmp (const char *s1, const char *s2)
{
while (1)
{
char c1 = *s1++;
char c2 = *s2++;
if (c1 >= 'A' && c1 <= 'Z') c1 += 'a' -
'A';
if (c2 >= 'A' && c2 <= 'Z') c2 += 'a' -
'A';
if (c1 != c2) return c1 - c2;
if (c1 == '\0') return 0;
}
}
--
Ben
In order to save my hands, I am cutting back on my mail. I also write
as succinctly as possible -- please don't be offended. If you send me
mail, you _will_ get a response, but please be patient, especially for
XEmacs-related mail. If you need an immediate response and it is not
apparent in your message, please say so. Thanks for your understanding.
See also
http://www.666.com/ben/chronic-pain/