From bd7d135c89bca216334cedf40e8dbce9507a04f0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 25 Nov 2018 02:10:36 +0100 Subject: [PATCH] msginit: On native Windows, produce same PO header as on Unix. * gettext-tools/src/msginit.c (plural_forms): Eliminate a trailing CR. --- gettext-tools/src/msginit.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.47.3