summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2001-02-05 18:41:37 +0000
committerBruno Haible <bruno@clisp.org>2001-02-05 18:41:37 +0000
commit25c7f881a50ea68d71b96588d04c7920d9201606 (patch)
treedfe997d8feea5969431ce63c3a44303e8626e8be /src
parent1fdb3de89f6349cdb5bc6de495d7b7d25e72d335 (diff)
downloadexternal_gettext-25c7f881a50ea68d71b96588d04c7920d9201606.zip
external_gettext-25c7f881a50ea68d71b96588d04c7920d9201606.tar.gz
external_gettext-25c7f881a50ea68d71b96588d04c7920d9201606.tar.bz2
Use O_BINARY where necessary.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/msgfmt.c7
-rw-r--r--src/msgunfmt.c5
3 files changed, 14 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c569b9d..7d9f440 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2001-02-04 Bruno Haible <haible@clisp.cons.org>
+
+ * msgfmt.c (main): Open the output file in binary mode.
+ * msgunfmt.c (read_mo_file): Open the input file in binary mode.
+
2001-01-21 Bruno Haible <haible@clisp.cons.org>
Use libtool.
diff --git a/src/msgfmt.c b/src/msgfmt.c
index 0f653ab..00bab40 100644
--- a/src/msgfmt.c
+++ b/src/msgfmt.c
@@ -319,7 +319,10 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
if (domain->symbol_tab.filled != 0)
{
if (strcmp (domain->domain_name, "-") == 0)
- output_file = stdout;
+ {
+ output_file = stdout;
+ setmode (fileno (output_file), O_BINARY);
+ }
else
{
const char *fname;
@@ -327,7 +330,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
fname = strict_uniforum ? add_mo_suffix (domain->domain_name)
: domain->domain_name;
- output_file = fopen (fname, "w");
+ output_file = fopen (fname, "wb");
if (output_file == NULL)
{
error (0, errno,
diff --git a/src/msgunfmt.c b/src/msgunfmt.c
index 3dd2cec..04064d8 100644
--- a/src/msgunfmt.c
+++ b/src/msgunfmt.c
@@ -348,7 +348,10 @@ read_mo_file (mlp, fn)
int j;
if (strcmp (fn, "-") == 0 || strcmp (fn, "/dev/stdin") == 0)
- fp = stdin;
+ {
+ fp = stdin;
+ setmode (fileno (fp), O_BINARY);
+ }
else
{
fp = fopen (fn, "rb");