From: Daiki Ueno Date: Mon, 21 Apr 2014 08:54:38 +0000 (+0900) Subject: msgfilter: Fix single quote handling in the quot filter X-Git-Tag: v0.19~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17fc629f733da759d1b42efa359991572e6e65c5;p=thirdparty%2Fgettext.git msgfilter: Fix single quote handling in the quot filter * filter-quote.c (convert_ascii_quote_to_unicode): Fix single quote handling to accept multiple quotations in a string. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index b4ee00b6b..d0104b7bf 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,9 @@ +2014-04-21 Daiki Ueno + + msgfilter: Fix single quote handling in the quot filter + * filter-quote.c (convert_ascii_quote_to_unicode): Fix single + quote handling to accept multiple quotations in a string. + 2014-04-17 Daiki Ueno xgettext: Strip multiple ".in" suffixes from the file name. diff --git a/gettext-tools/src/filter-quote.c b/gettext-tools/src/filter-quote.c index ea74b125e..d69bd615c 100644 --- a/gettext-tools/src/filter-quote.c +++ b/gettext-tools/src/filter-quote.c @@ -71,8 +71,6 @@ convert_ascii_quote_to_unicode (const char *input, size_t input_len, for (p = start; p <= end; p++) { - int j; - switch (*p) { case '"': @@ -188,8 +186,7 @@ convert_ascii_quote_to_unicode (const char *input, size_t input_len, } state = false; } - else if (start == input || *(start - 1) == '\n' - || *(start - 1) == ' ') + else if (p == input || *(p - 1) == '\n' || *(p - 1) == ' ') { /* Copy the preceding string to R. */ memcpy (r, start, p - start); diff --git a/gettext-tools/tests/msgfilter-quote-1 b/gettext-tools/tests/msgfilter-quote-1 index c299641b5..fe3364374 100755 --- a/gettext-tools/tests/msgfilter-quote-1 +++ b/gettext-tools/tests/msgfilter-quote-1 @@ -20,12 +20,18 @@ msgstr "\"double quoted\"" msgid "\"\"double quoted\"" msgstr "\"\"double quoted\"" +msgid "\"foo\" \"bar\" \"baz\"" +msgstr "\"foo\" \"bar\" \"baz\"" + msgid "double quoted but empty \"\"" msgstr "double quoted but empty \"\"" msgid "'single quoted'" msgstr "'single quoted'" +msgid "'foo' 'bar' 'baz'" +msgstr "'foo' 'bar' 'baz'" + msgid "prefix'single quoted without surrounding spaces'suffix" msgstr "prefix'single quoted without surrounding spaces'suffix" @@ -86,12 +92,18 @@ msgstr "“double quoted”" msgid "\"\"double quoted\"" msgstr "\"\"double quoted\"" +msgid "\"foo\" \"bar\" \"baz\"" +msgstr "“foo” “bar” “baz”" + msgid "double quoted but empty \"\"" msgstr "double quoted but empty \"\"" msgid "'single quoted'" msgstr "'single quoted'" +msgid "'foo' 'bar' 'baz'" +msgstr "‘foo’ ‘bar’ ‘baz’" + msgid "prefix'single quoted without surrounding spaces'suffix" msgstr "prefix'single quoted without surrounding spaces'suffix" @@ -154,12 +166,18 @@ msgstr "“double quoted”" msgid "\"\"double quoted\"" msgstr "\"\"double quoted\"" +msgid "\"foo\" \"bar\" \"baz\"" +msgstr "“foo” “bar” “baz”" + msgid "double quoted but empty \"\"" msgstr "double quoted but empty \"\"" msgid "'single quoted'" msgstr "'single quoted'" +msgid "'foo' 'bar' 'baz'" +msgstr "‘foo’ ‘bar’ ‘baz’" + msgid "prefix'single quoted without surrounding spaces'suffix" msgstr "prefix'single quoted without surrounding spaces'suffix"