Necessary for cygwin. Technically, this patch is not correct,
in that it clobbers O_APPEND, but it is no different than any
other use of xfreopen to force binary mode, so all such uses
should be fixed at once in a later patch.
* src/base64.c (main): Open input in binary mode.
* THANKS: Update.
Reported by Yutaka Amanai.
Won-kyu Park wkpark@chem.skku.ac.kr
Yanko Kaneti yaneti@declera.com
Yann Dirson dirson@debian.org
+Yutaka Amanai yasai-itame1942@jade.plala.or.jp
Zvi Har'El rl@math.technion.ac.il
;; Local Variables:
#include "xstrtol.h"
#include "quote.h"
#include "quotearg.h"
+#include "xfreopen.h"
#include "base64.h"
infile = "-";
if (STREQ (infile, "-"))
- input_fh = stdin;
+ {
+ if (O_BINARY)
+ xfreopen (NULL, "rb", stdin);
+ input_fh = stdin;
+ }
else
{
- input_fh = fopen (infile, "r");
+ input_fh = fopen (infile, "rb");
if (input_fh == NULL)
error (EXIT_FAILURE, errno, "%s", infile);
}