This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix typo in loadlocale


Hi,

I just applied the below patch as obvious.  The typos disallowed any
POSIX-compatible locale setting with languages and territories
containing the characters a and z.  Serves me right for testing with
"de_DE" all the time... :}


Corinna


	* libc/locale/locale.c (loadlocale): Fix typo in language and
        territory evaluation.


Index: libc/locale/locale.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/locale/locale.c,v
retrieving revision 1.9
diff -u -p -r1.9 locale.c
--- libc/locale/locale.c    3 Mar 2009 09:28:45 -0000       1.9
+++ libc/locale/locale.c    23 Mar 2009 11:24:13 -0000
@@ -391,16 +391,16 @@ loadlocale(struct _reent *p, int categor
 
       /* Don't use ctype macros here, they might be localized. */
       /* Language */
-      if (c[0] <= 'a' || c[0] >= 'z'
-         || c[1] <= 'a' || c[1] >= 'z')
+      if (c[0] < 'a' || c[0] > 'z'
+         || c[1] < 'a' || c[1] > 'z')
        return NULL;
       c += 2;
       if (c[0] == '_')
         {
          /* Territory */
          ++c;
-         if (c[0] <= 'A' || c[0] >= 'Z'
-             || c[1] <= 'A' || c[1] >= 'Z')
+         if (c[0] < 'A' || c[0] > 'Z'
+             || c[1] < 'A' || c[1] > 'Z')
            return NULL;
          c += 2;
        }


-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]