> From: Bruno Haible <br...@clisp.org> > Cc: gavinsmith0...@gmail.com, bug-texinfo@gnu.org > Date: Sun, 15 Oct 2023 16:25:56 +0200 > > Eli Zaretskii wrote: > > _popen accepts a MODE argument which can be used to control that, see > > > > > > https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/popen-wpopen?view=msvc-170 > > > > We use this in the stand-alone Info reader, for example, in this > > snippet from info/filesys.c: > > > > stream = popen (command, FOPEN_RBIN); > > This is good. But there are these two occurrences of popen(): > > 1) > info/man.c: > fpipe = popen (cmdline, "r"); > > Should better use FOPEN_RBIN as well.
No, because any 'man' program on Windows is likely to produce CRLF EOLs when it writes to stdout. > 2) > info/session.c: > printer_pipe = fopen (++print_command, "w"); > printer_pipe = popen (print_command, "w"); > > Should better use FOPEN_WBIN. No, because we write to a 'lpr' work-alike, which on Windows should be able to handle CRLF EOLs.