From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id 7E8A6385828E; Tue, 5 Jul 2022 08:51:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E8A6385828E Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc] localedef: Support building for older C standards X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/master X-Git-Oldrev: 01441ae33307c9c496e757c00c8b7ffa088f4055 X-Git-Newrev: 9d77023bf33ca5d0b07c318fe9fbe4347f0ae25a Message-Id: <20220705085128.7E8A6385828E@sourceware.org> Date: Tue, 5 Jul 2022 08:51:28 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2022 08:51:28 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9d77023bf33ca5d0b07c318fe9fbe4347f0ae25a commit 9d77023bf33ca5d0b07c318fe9fbe4347f0ae25a Author: Florian Weimer 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);