1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

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
This commit is contained in:
drh
2008-05-12 16:17:42 +00:00
parent 47cd39c9d2
commit 498b87676b
3 changed files with 17 additions and 11 deletions

View File

@@ -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;