]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
msginit: On native Windows, produce same PO header as on Unix.
authorBruno Haible <bruno@clisp.org>
Sun, 25 Nov 2018 01:10:36 +0000 (02:10 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 25 Nov 2018 01:10:36 +0000 (02:10 +0100)
* gettext-tools/src/msginit.c (plural_forms): Eliminate a trailing CR.

gettext-tools/src/msginit.c

index e9316aebd30d10d5bb49ccd9af45ea5735c43dae..f7c12dcc935105a486463253064b52c0274a5967 100644 (file)
@@ -1409,7 +1409,13 @@ plural_forms ()
           goto failed;
         }
       if (linelen > 0 && line[linelen - 1] == '\n')
-        line[linelen - 1] = '\0';
+        {
+          line[linelen - 1] = '\0';
+#if defined _WIN32 && ! defined __CYGWIN__
+          if (linelen > 1 && line[linelen - 2] == '\r')
+            line[linelen - 2] = '\0';
+#endif
+        }
 
       fclose (fp);