aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-05-12 16:17:42 +0000
committerdrh <drh@noemail.net>2008-05-12 16:17:42 +0000
commit498b87676bb6be34d34e18eab7772885f37f97bb (patch)
treed758c4f09cf1305cfd57b7e6a53c2ee950797ec1 /src
parent47cd39c9d2c46b1f9186f2caea2daacd111fc1a8 (diff)
downloadsqlite-498b87676bb6be34d34e18eab7772885f37f97bb.tar.gz
sqlite-498b87676bb6be34d34e18eab7772885f37f97bb.zip
Add "b" to fopen() in the hexio tests so that extra carriage returns are
not inserted on win32 and OS/2. Test harness change only - no changes to the core SQLite code. (CVS 5124) FossilOrigin-Name: 68cbc6b45c98ebaeca74e1ff5acc3ff7e34f45e9
Diffstat (limited to 'src')
-rw-r--r--src/test_hexio.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/test_hexio.c b/src/test_hexio.c
index 4dc83e976..9e1e8de80 100644
--- a/src/test_hexio.c
+++ b/src/test_hexio.c
@@ -17,7 +17,7 @@
** with historical versions of the "binary" command. So it seems
** easier and safer to build our own mechanism.
**
-** $Id: test_hexio.c,v 1.6 2007/10/19 17:47:25 drh Exp $
+** $Id: test_hexio.c,v 1.7 2008/05/12 16:17:42 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -119,7 +119,10 @@ static int hexio_read(
if( zBuf==0 ){
return TCL_ERROR;
}
- in = fopen(zFile, "r");
+ in = fopen(zFile, "rb");
+ if( in==0 ){
+ in = fopen(zFile, "r");
+ }
if( in==0 ){
Tcl_AppendResult(interp, "cannot open input file ", zFile, 0);
return TCL_ERROR;
@@ -168,7 +171,10 @@ static int hexio_write(
return TCL_ERROR;
}
nOut = sqlite3TestHexToBin(zIn, nIn, aOut);
- out = fopen(zFile, "r+");
+ out = fopen(zFile, "r+b");
+ if( out==0 ){
+ out = fopen(zFile, "r+");
+ }
if( out==0 ){
Tcl_AppendResult(interp, "cannot open output file ", zFile, 0);
return TCL_ERROR;