Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen

Andreas Schwab <[email protected]> Fri, 22 May 2015 11:15:22 +0200
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <[email protected]>
Bruce Korb <[email protected]> writes:

> @@ -1402,12 +1402,12 @@ open_encoded_file (char const * local_name,
>        sprintf (p, uu_cmd_fmt, restore_name);
>      }
>  
> -  /* Don't use freadonly_mode because it might be "rb", while we need
> +  /* Don't use "r" FOPEN_BINARY mode because it might be "rb", while we need
>       text-mode read here, because we will be reading pure text from
>       uuencode, and we want to drop any CR characters from the CRLF
>       line endings, when we write the result into the shar.  */
>    {
> -    FILE * in_fp = popen (cmdline, "r");
> +    FILE * in_fp = popen (cmdline, "r" TEXT_MODE);

Didn't you mean FOPEN_TEXT?

Andreas.

-- 
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."