From cb9da089c9c5c2516d50925890cfafdf23c80b36 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Mon, 12 May 2014 18:14:54 +0900 Subject: msgfilter: Fix quote handling of doubled grave charaters * filter-quote.c (convert_ascii_quote_to_unicode): Fix handling of doubled grave characters. --- gettext-tools/src/ChangeLog | 6 ++++++ gettext-tools/src/filter-quote.c | 1 + gettext-tools/tests/ChangeLog | 4 ++++ gettext-tools/tests/msgfilter-quote-1 | 9 +++++++++ 4 files changed, 20 insertions(+) diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 6f662a4..1937a00 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,5 +1,11 @@ 2014-05-12 Daiki Ueno + msgfilter: Fix quote handling of doubled grave charaters + * filter-quote.c (convert_ascii_quote_to_unicode): Fix handling of + doubled grave characters. + +2014-05-12 Daiki Ueno + * msgfmt.c (add_languages): New function split from get_languages. (get_languages): Use add_languages instead of manually parsing LINGUAS envvar with strtok_r. diff --git a/gettext-tools/src/filter-quote.c b/gettext-tools/src/filter-quote.c index d69bd61..4cddf09 100644 --- a/gettext-tools/src/filter-quote.c +++ b/gettext-tools/src/filter-quote.c @@ -125,6 +125,7 @@ convert_ascii_quote_to_unicode (const char *input, size_t input_len, if (*start == '`') { memcpy (r, start, p - start); + r += p - start; start = p; } } diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index dd47ea6..ad6362d 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,7 @@ +2014-05-12 Daiki Ueno + + * msgfilter-quote-1: Test doubled grave characters. + 2014-05-10 Guido Flohr msgattrib: Add --empty option to clear msgstr diff --git a/gettext-tools/tests/msgfilter-quote-1 b/gettext-tools/tests/msgfilter-quote-1 index fe33643..28b429a 100755 --- a/gettext-tools/tests/msgfilter-quote-1 +++ b/gettext-tools/tests/msgfilter-quote-1 @@ -70,6 +70,9 @@ msgstr "`single quoted with grave'" msgid "single quoted with grave, empty `'" msgstr "single quoted with grave, empty `'" + +msgid "``double grave'" +msgstr "``double grave'" EOF : ${MSGFILTER=msgfilter} @@ -142,6 +145,9 @@ msgstr "‘single quoted with grave’" msgid "single quoted with grave, empty `'" msgstr "single quoted with grave, empty ‘’" + +msgid "``double grave'" +msgstr "`‘double grave’" EOF : ${DIFF=diff} @@ -216,6 +222,9 @@ msgstr "‘single quoted with grave’" msgid "single quoted with grave, empty `'" msgstr "single quoted with grave, empty ‘’" + +msgid "``double grave'" +msgstr "`‘double grave’" EOF ${DIFF} mfi-boldquot.ok mfi-boldquot.out || exit 1 -- cgit v1.1