X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=ascii.c;h=e588f612a64f77c6b396936aeef6acfa292b80ba;hp=d4553f683012a648a235dfcbcd0be5948e527a6a;hb=df70e07e24add1869bcc9b7af2277d9d0c09a281;hpb=6833ce8bdca2d64e14485118f2a4417b7e1cb1b1 diff --git a/ascii.c b/ascii.c index d4553f6..e588f61 100644 --- a/ascii.c +++ b/ascii.c @@ -26,6 +26,10 @@ * locale-insensitive. */ +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include #include #include "ascii.h" @@ -44,7 +48,7 @@ int ascii_toupper (int c) { if (ascii_islower (c)) return c & ~32; - + return c; } @@ -52,46 +56,44 @@ int ascii_tolower (int c) { if (ascii_isupper (c)) return c | 32; - + return c; } int ascii_strcasecmp (const char *a, const char *b) { int i; - + if (a == b) return 0; if (a == NULL && b) return -1; if (b == NULL && a) return 1; - - for (; *a || *b; a++, b++) - { + + for (; *a || *b; a++, b++) { if ((i = ascii_tolower (*a) - ascii_tolower (*b))) return i; } - + return 0; } int ascii_strncasecmp (const char *a, const char *b, int n) { int i, j; - + if (a == b) return 0; if (a == NULL && b) return -1; if (b == NULL && a) return 1; - - for (j = 0; (*a || *b) && j < n; a++, b++, j++) - { + + for (j = 0; (*a || *b) && j < n; a++, b++, j++) { if ((i = ascii_tolower (*a) - ascii_tolower (*b))) return i; } - + return 0; }