public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Florian Weimer <fw@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] localedef: Support building for older C standards
Date: Tue,  5 Jul 2022 08:51:28 +0000 (GMT)	[thread overview]
Message-ID: <20220705085128.7E8A6385828E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9d77023bf33ca5d0b07c318fe9fbe4347f0ae25a

commit 9d77023bf33ca5d0b07c318fe9fbe4347f0ae25a
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue Jul 5 10:30:20 2022 +0200

    localedef: Support building for older C standards
    
    Fixes commit b15538d77c6a7893c8bb42831dcd3a1a12b727d4
    ("locale: localdef input files are now encoded in UTF-8").

Diff:
---
 locale/programs/linereader.c | 20 +++++++++++---------
 1 file 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);


                 reply	other threads:[~2022-07-05  8:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220705085128.7E8A6385828E@sourceware.org \
    --to=fw@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).