1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +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

@ -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