From: Bruno Haible Date: Sun, 25 Nov 2018 01:10:36 +0000 (+0100) Subject: msginit: On native Windows, produce same PO header as on Unix. X-Git-Tag: v0.20~205 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd7d135c89bca216334cedf40e8dbce9507a04f0;p=thirdparty%2Fgettext.git msginit: On native Windows, produce same PO header as on Unix. * gettext-tools/src/msginit.c (plural_forms): Eliminate a trailing CR. --- diff --git a/gettext-tools/src/msginit.c b/gettext-tools/src/msginit.c index e9316aebd..f7c12dcc9 100644 --- a/gettext-tools/src/msginit.c +++ b/gettext-tools/src/msginit.c @@ -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);