From 546dad3b7e749abf023dc6d07cc45da9b02ec23f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 4 Mar 2002 12:16:04 +0000 Subject: [PATCH] "&&" means no accelerator. --- src/ChangeLog | 5 +++++ src/msgfmt.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a787e89bd..9b8d00028 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-03-02 Bruno Haible + + * msgfmt.c (check_pair): Don't count "&&" as an accelerator designator, + for consistency with Qt and KDE. + 2002-02-24 Bruno Haible * po-lex.c: Include libstdarg.h. diff --git a/src/msgfmt.c b/src/msgfmt.c index be5c2dc06..5b2ca40ec 100644 --- a/src/msgfmt.c +++ b/src/msgfmt.c @@ -1181,11 +1181,14 @@ check_pair (msgid, msgid_pos, msgid_plural, msgstr, msgstr_len, msgstr_pos, p = strchr (msgid, accelerator_char); if (p != NULL && strchr (p + 1, accelerator_char) == NULL) { - /* Count the number of '&' in msgstr. */ + /* Count the number of '&' in msgstr, but ignore '&&'. */ unsigned int count = 0; for (p = msgstr; (p = strchr (p, accelerator_char)) != NULL; p++) - count++; + if (p[1] == accelerator_char) + p++; + else + count++; if (count == 0) { -- 2.47.2