]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
localedef: Support building for older C standards
authorFlorian Weimer <fweimer@redhat.com>
Tue, 5 Jul 2022 08:30:20 +0000 (10:30 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 5 Jul 2022 08:30:20 +0000 (10:30 +0200)
Fixes commit b15538d77c6a7893c8bb42831dcd3a1a12b727d4
("locale: localdef input files are now encoded in UTF-8").

locale/programs/linereader.c

index b484327969bb2f273cf4a71eaf3f0edcdeefc842..0460074a0c9ee723cfb4405d9b4792a1e3ee8d0a 100644 (file)
@@ -330,15 +330,17 @@ lr_token (struct linereader *lr, const struct charmap_t *charmap,
       break;
 
     case 0x80 ... 0xff:                /* UTF-8 sequence.  */
-      uint32_t wch;
-      if (!utf8_decode (lr, ch, &wch))
-       {
-         lr->token.tok = tok_error;
-         return &lr->token;
-       }
-      lr->token.tok = tok_ucs4;
-      lr->token.val.ucs4 = wch;
-      return &lr->token;
+      {
+       uint32_t wch;
+       if (!utf8_decode (lr, ch, &wch))
+         {
+           lr->token.tok = tok_error;
+           return &lr->token;
+         }
+       lr->token.tok = tok_ucs4;
+       lr->token.val.ucs4 = wch;
+       return &lr->token;
+      }
     }
 
   return get_ident (lr);