diff options
author | larrybr <larrybr@noemail.net> | 2023-12-13 20:37:20 +0000 |
---|---|---|
committer | larrybr <larrybr@noemail.net> | 2023-12-13 20:37:20 +0000 |
commit | 9e488a5a408099361e3bdd9841c1000945ab43b9 (patch) | |
tree | 9840dfa6f44c52c7467c52c05152507f11dc80b5 /src | |
parent | 3e4195c60db744c69bb24e71236631a80f2ef547 (diff) | |
download | sqlite-9e488a5a408099361e3bdd9841c1000945ab43b9.tar.gz sqlite-9e488a5a408099361e3bdd9841c1000945ab43b9.zip |
In CLI, fix .read inability to open 2GB+ files on WIN32.
FossilOrigin-Name: 56c80a62d2e033d64ba5d545ae9cbe3ed7c9d046c0a3fafb6cfa2f0b562d1ef0
Diffstat (limited to 'src')
-rw-r--r-- | src/shell.c.in | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shell.c.in b/src/shell.c.in index 35ed0cb5c..26b44e05a 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -736,14 +736,14 @@ static int strlenChar(const char *z){ */ static FILE * openChrSource(const char *zFile){ #if defined(_WIN32) || defined(WIN32) - struct _stat x = {0}; + struct __stat64 x = {0}; # define STAT_CHR_SRC(mode) ((mode & (_S_IFCHR|_S_IFIFO|_S_IFREG))!=0) /* On Windows, open first, then check the stream nature. This order ** is necessary because _stat() and sibs, when checking a named pipe, ** effectively break the pipe as its supplier sees it. */ FILE *rv = fopen(zFile, "rb"); if( rv==0 ) return 0; - if( _fstat(_fileno(rv), &x) != 0 + if( _fstat64(_fileno(rv), &x) != 0 || !STAT_CHR_SRC(x.st_mode)){ fclose(rv); rv = 0; |