From: Daiki Ueno Date: Wed, 8 Oct 2014 07:12:35 +0000 (+0900) Subject: msgunfmt: Error on incomplete multibyte sequence at EOF X-Git-Tag: v0.19.3~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28a02a6f4f419534a6e0aa76e82d12d1e8ceaf9d;p=thirdparty%2Fgettext.git msgunfmt: Error on incomplete multibyte sequence at EOF * write-po.c (wrap): Report error on incomplete multibyte sequence at the end of input bytes. Reported by Jakub Wilk at: . --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index f605cb815..32e4b96e4 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,10 @@ +2014-10-08 Daiki Ueno + + * write-po.c (wrap): Report error on incomplete multibyte sequence + at the end of input bytes. + Reported by Jakub Wilk at: + . + 2014-09-30 Daiki Ueno * x-c.c (literalstring_parse): Fix octal character escape handling. diff --git a/gettext-tools/src/write-po.c b/gettext-tools/src/write-po.c index cee086f6c..d49a95fab 100644 --- a/gettext-tools/src/write-po.c +++ b/gettext-tools/src/write-po.c @@ -812,6 +812,15 @@ wrap (const message_ty *mp, ostream_t stream, _("invalid multibyte sequence")); continue; } + else if (errno == EINVAL) + { + /* This could happen if an incomplete + multibyte sequence at the end of input + bytes. */ + po_xerror (PO_SEVERITY_ERROR, mp, NULL, 0, 0, false, + _("incomplete multibyte sequence")); + continue; + } else abort (); }