]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
msgfilter: Fix single quote handling in the quot filter
authorDaiki Ueno <ueno@gnu.org>
Mon, 21 Apr 2014 08:54:38 +0000 (17:54 +0900)
committerDaiki Ueno <ueno@gnu.org>
Mon, 21 Apr 2014 08:54:47 +0000 (17:54 +0900)
* filter-quote.c (convert_ascii_quote_to_unicode): Fix single
quote handling to accept multiple quotations in a string.

gettext-tools/src/ChangeLog
gettext-tools/src/filter-quote.c
gettext-tools/tests/msgfilter-quote-1

index b4ee00b6b66b5c9196603b14d4ea05982dfc608e..d0104b7bffffe2b5b39fa22072999fff49a146b1 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-21  Daiki Ueno  <ueno@gnu.org>
+
+       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  <ueno@gnu.org>
 
        xgettext: Strip multiple ".in" suffixes from the file name.
index ea74b125ea1ce124bbfed52ba767ecbb4af7c486..d69bd615c745307340e981bd9bbf7280c44ea933 100644 (file)
@@ -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);
index c299641b55301eea3f3761fa1f90f5b5dc428142..fe3364374b01e4a4759cdeb7ea0dbd1b2b5ffdde 100755 (executable)
@@ -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 "“\e[1mdouble quoted\e[0m”"
 msgid "\"\"double quoted\""
 msgstr "\"\"double quoted\""
 
+msgid "\"foo\" \"bar\" \"baz\""
+msgstr "“\e[1mfoo\e[0m” “\e[1mbar\e[0m” “\e[1mbaz\e[0m”"
+
 msgid "double quoted but empty \"\""
 msgstr "double quoted but empty \"\""
 
 msgid "'single quoted'"
 msgstr "'single quoted'"
 
+msgid "'foo' 'bar' 'baz'"
+msgstr "‘\e[1mfoo\e[0m’ ‘\e[1mbar\e[0m’ ‘\e[1mbaz\e[0m’"
+
 msgid "prefix'single quoted without surrounding spaces'suffix"
 msgstr "prefix'single quoted without surrounding spaces'suffix"