shithub: sox

Download patch

ref: 050b3330521b741c74c46c6d689f7be4ebc0a7a6
parent: c428282125ba0ccbd085c0cfdc061a55ee64208c
author: Ulrich Klauer <ulrich@chirlu.de>
date: Mon Jan 28 18:16:24 EST 2013

Use binary mode for pipes on all Windows compilers

The fix from 14.4.0 to call popen() with a type argument of "rb"
(binary mode) was active only on MSVC, not on other Windows compilers;
in particular, the distributed Windows binary still used "r" (text
mode), as it is compiled using MinGW.

This fixes tracker item 3602130.

--- a/ChangeLog
+++ b/ChangeLog
@@ -46,6 +46,8 @@
   o Fix input length calculation for combine methods other than
     concatenate. (Ulrich Klauer)
   o Fix to configure.ac to work with Autoconf 2.69. [3600293] (cbagwell)
+  o Use binary mode for pipes on all Windows compilers, rather than
+    MSVC only. [3602130] (Ulrich Klauer)
 
 
 sox-14.4.0	2012-03-04
--- a/src/util.h
+++ b/src/util.h
@@ -120,7 +120,6 @@
 #define open _open
 #define pclose _pclose
 #define popen _popen
-#define POPEN_MODE "rb"
 #define setmode _setmode
 #define snprintf _snprintf
 
@@ -160,6 +159,7 @@
   #define LAST_SLASH(path) max(strrchr(path, '/'), strrchr(path, '\\'))
   #define IS_ABSOLUTE(path) ((path)[0] == '/' || (path)[0] == '\\' || (path)[1] == ':')
   #define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
+  #define POPEN_MODE "rb"
 #else
   #define LAST_SLASH(path) strrchr(path, '/')
   #define IS_ABSOLUTE(path) ((path)[0] == '/')