diff options
author | Nicolas Williams <nico@cryptonector.com> | 2019-03-24 14:39:58 -0500 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2019-03-24 23:23:16 -0500 |
commit | 0dab2b18d73e561f5118011a65cc9877bf21c110 (patch) | |
tree | d4e212238e3a1915a433b497748ca35071940448 /src | |
parent | 3e0a11888644fd7660af2ac241cd5c97cf12feb4 (diff) |
Add -b / --binary option for Windows
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -394,6 +394,16 @@ int main(int argc, char* argv[]) { options |= RAW_OUTPUT | RAW_NO_LF; if (!short_opts) continue; } + if (isoption(argv[i], 'b', "binary", &short_opts)) { +#ifdef WIN32 + fflush(stdout); + fflush(stderr); + _setmode(fileno(stdin), _O_BINARY); + _setmode(fileno(stdout), _O_BINARY); + _setmode(fileno(stderr), _O_BINARY); + if (!short_opts) continue; +#endif + } if (isoption(argv[i], 0, "tab", &short_opts)) { dumpopts &= ~JV_PRINT_INDENT_FLAGS(7); dumpopts |= JV_PRINT_TAB | JV_PRINT_PRETTY; |