From: Bruno Haible Date: Thu, 18 Sep 2003 12:10:21 +0000 (+0000) Subject: Improve error behaviour. X-Git-Tag: v0.13~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4f0b995ab50d349bfa9a660cbafff37a0e22c93;p=thirdparty%2Fgettext.git Improve error behaviour. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 49f1fc96b..daa38c8ea 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,12 @@ +2003-09-18 Bruno Haible + + * 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 . + 2003-09-13 Bruno Haible * format-sh.c (INVALID_SHELL_SYNTAX, diff --git a/gettext-tools/src/x-perl.c b/gettext-tools/src/x-perl.c index ca2e807c5..71fc7fd29 100644 --- a/gettext-tools/src/x-perl.c +++ b/gettext-tools/src/x-perl.c @@ -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); diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index 0cd07abeb..b494bafef 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -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)