about summary refs log tree commit diff
path: root/locale
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-07-05 10:30:20 +0200
committerFlorian Weimer <fweimer@redhat.com>2022-07-05 10:30:20 +0200
commit9d77023bf33ca5d0b07c318fe9fbe4347f0ae25a (patch)
treeae70823accf5683a2bbc5ae3732be58c6371091e /locale
parent01441ae33307c9c496e757c00c8b7ffa088f4055 (diff)
downloadglibc-9d77023bf33ca5d0b07c318fe9fbe4347f0ae25a.tar.gz
glibc-9d77023bf33ca5d0b07c318fe9fbe4347f0ae25a.tar.xz
glibc-9d77023bf33ca5d0b07c318fe9fbe4347f0ae25a.zip
localedef: Support building for older C standards
Fixes commit b15538d77c6a7893c8bb42831dcd3a1a12b727d4
("locale: localdef input files are now encoded in UTF-8").
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/linereader.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
index b484327969..0460074a0c 100644
--- a/locale/programs/linereader.c
+++ b/locale/programs/linereader.c
@@ -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);