emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using strcasecmp in xterm.c


From: Kim F. Storm
Subject: Re: Using strcasecmp in xterm.c
Date: Thu, 07 Dec 2006 14:06:56 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

Kenichi Handa <address@hidden> writes:

> In article <address@hidden>, address@hidden (Kim F. Storm) writes:
>
>> In xterm.c, we use strcasecmp here:
>
>> struct font_info *
>> x_query_font (f, fontname)
>>      struct frame *f;
>>      register char *fontname;
>> {
>>   struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
>>   int i;
>
>>   for (i = 0; i < dpyinfo->n_fonts; i++)
>>     if (dpyinfo->font_table[i].name
>>      && (!strcasecmp (dpyinfo->font_table[i].name, fontname)
>>          || !strcasecmp (dpyinfo->font_table[i].full_name, fontname)))
>>       return (dpyinfo->font_table + i);
>>   return NULL;
>> }
>
>
>> Shouldn't this use xstricmp which is specifically defined to compare
>> fontnames according to the comment in xfaces.c ?
>
> What is the difference between xstricmp and strcasecmp?

I dunno -- but strcasecmp doesn't exist on all systems (I just learned
that), and xstricmp comes with Emacs, so it seems safer to use it.

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]