]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Improve error behaviour.
authorBruno Haible <bruno@clisp.org>
Thu, 18 Sep 2003 12:10:21 +0000 (12:10 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:00 +0000 (12:11 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/x-perl.c
gettext-tools/src/xgettext.c

index 49f1fc96bf10576ed415d72577023e00d39c0833..daa38c8ea6ba4257461a07c17ee52675fbf6340f 100644 (file)
@@ -1,3 +1,12 @@
+2003-09-18  Bruno Haible  <bruno@clisp.org>
+
+       * xgettext.c (from_current_source_encoding): Use multiline_error,
+       for a prettier error message.
+
+       * x-perl.c (extract_quotelike_pass1): Store counter_delim instead of
+       EOF as delimiter, to avoid error during from_current_source_encoding.
+       Reported by Crispin Flowerday <cflowerday@zeus.com>.
+
 2003-09-13  Bruno Haible  <bruno@clisp.org>
 
        * format-sh.c (INVALID_SHELL_SYNTAX,
index ca2e807c5a79f5580ae117e882dc152d558318f4..71fc7fd29cb3908087a229525da44fc0077be711 100644 (file)
@@ -609,9 +609,7 @@ extract_quotelike_pass1 (int delim)
 
       if (c == counter_delim || c == EOF)
        {
-         /* Copying the EOF (actually 255) is not an error.  It will
-            be stripped off later.  */
-         buffer[bufpos++] = c;
+         buffer[bufpos++] = counter_delim; /* will be stripped off later */
          buffer[bufpos++] = '\0';
 #if DEBUG_PERL
          fprintf (stderr, "PASS1: %s\n", buffer);
index 0cd07abeba07f7c3bff1864a29da6346a0a7930f..b494bafefae9d6d186379c75954e374bd9b66735 100644 (file)
@@ -1051,10 +1051,12 @@ from_current_source_encoding (const char *string,
            buffer[0] = '\0';
          else
            sprintf (buffer, ":%ld", (long) line_number);
-         error (EXIT_FAILURE, 0, _("\
+         multiline_error (xstrdup (""),
+                          xasprintf (_("\
 Non-ASCII string at %s%s.\n\
-Please specify the source encoding through --from-code."),
-                file_name, buffer);
+Please specify the source encoding through --from-code.\n"),
+                                     file_name, buffer));
+         exit (EXIT_FAILURE);
        }
     }
   else if (xgettext_current_source_encoding != po_charset_utf8)