|
From: | Paul Eggert |
Subject: | Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen |
Date: | Thu, 21 May 2015 09:51:42 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
On 05/21/2015 09:36 AM, Filipe Brandenburger wrote:
Any suggestions of what's the best way to solve this?
I suggest doing what Emacs does. Put this in a header somewhere: #if O_BINARY # define FOPEN_BINARY "b" # define FOPEN_TEXT "t" #else # define FOPEN_BINARY "" # define FOPEN_TEXT "" #endifand then call 'popen (cmd, "r" FOPEN_BINARY)'. Emacs does the same thing with fopen of course. In practice this is good enough.
[Prev in Thread] | Current Thread | [Next in Thread] |