1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Fix for toupper('I') != 'i'

This commit is contained in:
Werner Koch 2001-06-12 18:42:40 +00:00
parent ff170c94f1
commit 01fe1dd2a9
22 changed files with 156 additions and 47 deletions

View file

@ -1,3 +1,13 @@
2001-06-12 Werner Koch <wk@gnupg.org>
* getkey.c (compare_name): Use ascii_memistr(), ascii_memcasecmp()
* keyedit.c (keyedit_menu): Use ascii_strcasecmp().
* armor.c (radix64_read): Use ascii_toupper().
* ringedit.c (do_bm_search): Ditto.
* keygen.c (read_parameter_file): Ditto.
* openfile.c (CMP_FILENAME): Ditto.
* g10.c (i18n_init): We can now use just LC_ALL.
2001-05-29 Werner Koch <wk@gnupg.org>
* keygen.c (generate_subkeypair): Print a warning if a subkey is

View file

@ -649,9 +649,9 @@ radix64_read( armor_filter_context_t *afx, IOBUF a, size_t *retn,
if( isxdigit(cc1) && isxdigit(cc2)
&& strchr( "=\n\r\t ", cc3 )) {
/* well it seems to be the case - adjust */
c = isdigit(cc1)? (cc1 - '0'): (toupper(cc1)-'A'+10);
c = isdigit(cc1)? (cc1 - '0'): (ascii_toupper(cc1)-'A'+10);
c <<= 4;
c |= isdigit(cc2)? (cc2 - '0'): (toupper(cc2)-'A'+10);
c |= isdigit(cc2)? (cc2 - '0'): (ascii_toupper(cc2)-'A'+10);
afx->buffer_pos += 2;
afx->qp_detected = 1;
goto again;

View file

@ -513,12 +513,7 @@ i18n_init(void)
set_gettext_file( PACKAGE );
#else
#ifdef ENABLE_NLS
#ifdef HAVE_LC_MESSAGES
setlocale( LC_TIME, "" );
setlocale( LC_MESSAGES, "" );
#else
setlocale( LC_ALL, "" );
#endif
setlocale( LC_ALL, "" );
bindtextdomain( PACKAGE, G10_LOCALEDIR );
textdomain( PACKAGE );
#endif

View file

@ -1273,7 +1273,7 @@ compare_name( const char *uid, size_t uidlen, const char *name, int mode )
return 0; /* found */
}
else if( mode == 2 ) { /* case insensitive substring */
if( memistr( uid, uidlen, name ) )
if( ascii_memistr( uid, uidlen, name ) )
return 0;
}
else if( mode >= 3 && mode <= 5 ) { /* look at the email address */
@ -1287,11 +1287,12 @@ compare_name( const char *uid, size_t uidlen, const char *name, int mode )
if( i < uidlen ) {
i = se - s;
if( mode == 3 ) { /* exact email address */
if( strlen(name)-2 == i && !memicmp( s, name+1, i) )
if( strlen(name)-2 == i
&& !ascii_memcasecmp( s, name+1, i) )
return 0;
}
else if( mode == 4 ) { /* email substring */
if( memistr( s, i, name ) )
if( ascii_memistr( s, i, name ) )
return 0;
}
else { /* email from end */

View file

@ -721,7 +721,7 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands,
}
for(i=0; cmds[i].name; i++ ) {
if( !stricmp( answer, cmds[i].name ) )
if( !ascii_strcasecmp( answer, cmds[i].name ) )
break;
}
if( sign_mode && !cmds[i].signmode )

View file

@ -1292,17 +1292,17 @@ read_parameter_file( const char *fname )
;
value = p;
trim_trailing_ws( value, strlen(value) );
if( !stricmp( keyword, "%echo" ) )
if( !ascii_strcasecmp( keyword, "%echo" ) )
log_info("%s\n", value );
else if( !stricmp( keyword, "%dry-run" ) )
else if( !ascii_strcasecmp( keyword, "%dry-run" ) )
outctrl.dryrun = 1;
else if( !stricmp( keyword, "%commit" ) ) {
else if( !ascii_strcasecmp( keyword, "%commit" ) ) {
outctrl.lnr = lnr;
proc_parameter_file( para, fname, &outctrl );
release_parameter_list( para );
para = NULL;
}
else if( !stricmp( keyword, "%pubring" ) ) {
else if( !ascii_strcasecmp( keyword, "%pubring" ) ) {
if( outctrl.pub.fname && !strcmp( outctrl.pub.fname, value ) )
; /* still the same file - ignore it */
else {
@ -1311,7 +1311,7 @@ read_parameter_file( const char *fname )
outctrl.use_files = 1;
}
}
else if( !stricmp( keyword, "%secring" ) ) {
else if( !ascii_strcasecmp( keyword, "%secring" ) ) {
if( outctrl.sec.fname && !strcmp( outctrl.sec.fname, value ) )
; /* still the same file - ignore it */
else {
@ -1344,7 +1344,7 @@ read_parameter_file( const char *fname )
trim_trailing_ws( value, strlen(value) );
for(i=0; keywords[i].name; i++ ) {
if( !stricmp( keywords[i].name, keyword ) )
if( !ascii_strcasecmp( keywords[i].name, keyword ) )
break;
}
if( !keywords[i].name ) {

View file

@ -43,7 +43,7 @@
#endif
#ifdef HAVE_DRIVE_LETTERS
#define CMP_FILENAME(a,b) stricmp( (a), (b) )
#define CMP_FILENAME(a,b) ascii_strcasecmp( (a), (b) )
#else
#define CMP_FILENAME(a,b) strcmp( (a), (b) )
#endif

View file

@ -1000,8 +1000,8 @@ do_bm_search( const byte *buf, size_t buflen,
int c, c1;
for( i = --patlen; i < buflen; i += dist[c1] )
for( j=patlen, k=i, c1=c=toupper(buf[k]); c == pat[j];
j--, k--, c=toupper(buf[k]) ) {
for( j=patlen, k=i, c1=c=ascii_toupper(buf[k]); c == pat[j];
j--, k--, c=ascii_toupper(buf[k]) ) {
if( !j )
return buf+k;
}