]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix bug in multibyte parsing code.
authorBruno Haible <bruno@clisp.org>
Mon, 26 Sep 2005 09:18:50 +0000 (09:18 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:12:51 +0000 (12:12 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/x-csharp.c

index e372f99d014d087ba16e5daff11c50fb181e95db..bc859f6cb6812e0ec40ac7cd8575361004f64408 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-25  Bruno Haible  <bruno@clisp.org>
+
+       * 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  <bruno@clisp.org>
 
        * msgattrib.c (main): Invoke bindtextdomain for bison-runtime.
index eb433f39d2b4d0dd9c7b4a3cd977785f8439a0a9..91b939e69d4c32bc9dd9077dcf73741869e102ac 100644 (file)
@@ -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 (;;)
        {