Changeset 2371:62965bc72607 for attach.c

Show
Ignore:
Timestamp:
2001-04-26 06:36:33 (8 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Add ascii_strcasecmp() and ascii_strncasecmp() functions which do
locale-independent and case-insensitive string comparisons. Needed
for mutt to work in iso-8859-9 environments, where tolower('I') !=
'i'.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • attach.c

    r2282 r2371  
    303303        if (*(q+1) == '*') 
    304304        { 
    305           if (mutt_strncasecmp (buf, p, q-p) == 0) 
     305          if (ascii_strncasecmp (buf, p, q-p) == 0) 
    306306            return (1); 
    307307        } 
    308308        else 
    309309        { 
    310           if (mutt_strcasecmp (buf, p) == 0) 
     310          if (ascii_strcasecmp (buf, p) == 0) 
    311311            return (1); 
    312312        } 
     
    351351    i = mutt_strlen (t->data) - 1; 
    352352    if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' &&  
    353           mutt_strncasecmp (type, t->data, i) == 0) || 
    354           mutt_strcasecmp (type, t->data) == 0) 
     353         ascii_strncasecmp (type, t->data, i) == 0) || 
     354        ascii_strcasecmp (type, t->data) == 0) 
    355355      return 1; 
    356356  } 
     
    941941  } 
    942942 
    943   if (!mutt_strcasecmp ("text/plain", a->subtype) || 
    944       !mutt_strcasecmp ("application/postscript", a->subtype)) 
     943  if (!ascii_strcasecmp ("text/plain", a->subtype) || 
     944      !ascii_strcasecmp ("application/postscript", a->subtype)) 
    945945  { 
    946946    return (mutt_pipe_attachment (fp, a, NONULL(PrintCmd), NULL));