1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-07-02 02:48:57 +02:00

* fileutil.c (compare_filenames): Replaced stricmp by strcasecmp.

* miscutil.c (answer_is_yes_no_quit,answer_is_yes_no_default): Ditto.

* strgutil.c (strncasecmp): New.
(memicmp): Removed.
This commit is contained in:
Werner Koch 2002-05-22 09:09:24 +00:00
parent 09e732361a
commit eb1057be7c
4 changed files with 23 additions and 19 deletions

View File

@ -1,3 +1,11 @@
2002-05-22 Werner Koch <wk@gnupg.org>
* fileutil.c (compare_filenames): Replaced stricmp by strcasecmp.
* miscutil.c (answer_is_yes_no_quit,answer_is_yes_no_default): Ditto.
* strgutil.c (strncasecmp): New.
(memicmp): Removed.
2002-05-10 Stefan Bellon <sbellon@sbellon.de>
* memory.c (add_entry) [M_DEBUG]: Added some missing EXTRA_ALIGN.

View File

@ -153,7 +153,7 @@ compare_filenames( const char *a, const char *b )
abuf = gstrans(a);
bbuf = gstrans(b);
c = stricmp(abuf, bbuf);
c = strcasecmp (abuf, bbuf);
m_free(abuf);
m_free(bbuf);
@ -228,5 +228,3 @@ leave:
return rc;
}

View File

@ -299,12 +299,12 @@ answer_is_yes_no_default( const char *s, int def_answer )
const char *short_no = _("nN");
/* Note: we have to use the local dependent strcasecmp here */
if( !stricmp(s, long_yes ) )
if( !strcasecmp(s, long_yes ) )
return 1;
if( *s && strchr( short_yes, *s ) && !s[1] )
return 1;
/* test for no strings to catch ambiguities for the next test */
if( !stricmp(s, long_no ) )
if( !strcasecmp(s, long_no ) )
return 0;
if( *s && strchr( short_no, *s ) && !s[1] )
return 0;
@ -336,11 +336,11 @@ answer_is_yes_no_quit( const char *s )
const char *short_quit = _("qQ");
/* Note: We have to use the locale dependent strcasecmp */
if( !stricmp(s, long_no ) )
if( !strcasecmp(s, long_no ) )
return 0;
if( !stricmp(s, long_yes ) )
if( !strcasecmp(s, long_yes ) )
return 1;
if( !stricmp(s, long_quit ) )
if( !strcasecmp(s, long_quit ) )
return -1;
if( *s && strchr( short_no, *s ) && !s[1] )
return 0;
@ -359,5 +359,3 @@ answer_is_yes_no_quit( const char *s )
return -1;
return 0;
}

View File

@ -766,17 +766,17 @@ strcasecmp( const char *a, const char *b )
}
#endif
/****************
* mingw32/cpd has a memicmp()
*/
#ifndef HAVE_MEMICMP
#ifndef HAVE_STRNCASECMP
int
memicmp( const char *a, const char *b, size_t n )
strncasecmp( const char *a, const char *b, size_t n )
{
for( ; n; n--, a++, b++ )
if( *a != *b && toupper(*(const byte*)a) != toupper(*(const byte*)b) )
return *(const byte *)a - *(const byte*)b;
return 0;
for( ; n && *a && *b; a++, b++, n--) {
if( *a != *b && toupper(*a) != toupper(*b) )
break;
}
if (!n)
return 0;
return *(const byte*)a - *(const byte*)b;
}
#endif