From: Bruno Haible Date: Mon, 26 Sep 2005 09:18:50 +0000 (+0000) Subject: Fix bug in multibyte parsing code. X-Git-Tag: v0.15~389 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9b1758640464e30955eb37faf90cbf2d0ebcd83;p=thirdparty%2Fgettext.git Fix bug in multibyte parsing code. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index e372f99d0..bc859f6cb 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,8 @@ +2005-09-25 Bruno Haible + + * x-csharp.c (phase2_getc): Fix mis-use of iconv() when the source + encoding is neither ASCII nor UTF-8. + 2005-09-20 Bruno Haible * msgattrib.c (main): Invoke bindtextdomain for bison-runtime. diff --git a/gettext-tools/src/x-csharp.c b/gettext-tools/src/x-csharp.c index eb433f39d..91b939e69 100644 --- a/gettext-tools/src/x-csharp.c +++ b/gettext-tools/src/x-csharp.c @@ -231,7 +231,12 @@ Please specify the source encoding through --from-code.\n"), through phase1_getc as needed. This is needed to give reasonable interactive behaviour when fp is connected to an interactive tty. */ unsigned char buf[MAX_PHASE1_PUSHBACK]; - size_t bufcount = 0; + size_t bufcount; + int c = phase1_getc (); + if (c == EOF) + return UEOF; + buf[0] = (unsigned char) c; + bufcount = 1; for (;;) {