On Windows, when no temporary path is available, skip prepending the directory separator.

FossilOrigin-Name: 32b5c20e54474fcc33ba937293e97566a555e733
This commit is contained in:
mistachkin 2012-03-18 03:22:44 +00:00
parent 86f89871b0
commit 5593b2e653
3 changed files with 15 additions and 11 deletions

View File

@ -1,5 +1,5 @@
C Add\sSQLITE_OMIT_SHUTDOWN_DIRECTORIES\scompile-time\soption\sto\sdisable\sclearing\sthe\ssqlite3_data_directory\sand\ssqlite3_temp_directory\svariables\sduring\ssqlite3_shutdown.\s\sAlso,\sonly\sclear\sthe\svariables\sif\sthe\sheap\swas\sactually\sshutdown.
D 2012-03-18T01:32:44.771
C On\sWindows,\swhen\sno\stemporary\spath\sis\savailable,\sskip\sprepending\sthe\sdirectory\sseparator.
D 2012-03-18T03:22:44.499
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -167,7 +167,7 @@ F src/os.h 38aabd5e3ecd4162332076f55bb09cec02165cca
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_os2.c 4a75888ba3dfc820ad5e8177025972d74d7f2440
F src/os_unix.c 0e3d2942d228d0366fb80a3640f35caf413b66d1
F src/os_win.c 9bbe851c4299fd53dae0652fcd199025b755e8a4
F src/os_win.c aeb0aee1264e3eea9afffb7c945c734315043b29
F src/pager.c 3955b62cdb5bb64559607cb474dd12a6c8e1d4a5
F src/pager.h ef1eaf8593e78f73885c1dfac27ad83bee23bdc5
F src/parse.y 1ddd71ae55f4b7cbb2672526ea4de023de0f519e
@ -992,7 +992,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
P cd70bc4b788b947d47a7a7158c27028160df06bd
R d1f4973510f77bf75cb97abcded45ca7
P 1ae9f9e4f730eccbc0fc3408de1ac3c4be931e01
R e11c61d544eb2a069b5456711a5abf81
U mistachkin
Z 1223d82df9680759dd17a896969e8fb1
Z 9329238ea2411efabbbde93cdad877cd

View File

@ -1 +1 @@
1ae9f9e4f730eccbc0fc3408de1ac3c4be931e01
32b5c20e54474fcc33ba937293e97566a555e733

View File

@ -3307,6 +3307,7 @@ static int getTempname(int nBuf, char *zBuf){
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789";
size_t i, j;
int nTempPath;
char zTempPath[MAX_PATH+2];
/* It's odd to simulate an io-error here, but really this is just
@ -3352,15 +3353,18 @@ static int getTempname(int nBuf, char *zBuf){
/* Check that the output buffer is large enough for the temporary file
** name. If it is not, return SQLITE_ERROR.
*/
if( (sqlite3Strlen30(zTempPath) + sqlite3Strlen30(SQLITE_TEMP_FILE_PREFIX) + 18) >= nBuf ){
nTempPath = sqlite3Strlen30(zTempPath);
if( (nTempPath + sqlite3Strlen30(SQLITE_TEMP_FILE_PREFIX) + 18) >= nBuf ){
return SQLITE_ERROR;
}
for(i=sqlite3Strlen30(zTempPath); i>0 && zTempPath[i-1]=='\\'; i--){}
for(i=nTempPath; i>0 && zTempPath[i-1]=='\\'; i--){}
zTempPath[i] = 0;
sqlite3_snprintf(nBuf-18, zBuf,
"%s\\"SQLITE_TEMP_FILE_PREFIX, zTempPath);
sqlite3_snprintf(nBuf-18, zBuf, (nTempPath > 0) ?
"%s\\"SQLITE_TEMP_FILE_PREFIX : SQLITE_TEMP_FILE_PREFIX,
zTempPath);
j = sqlite3Strlen30(zBuf);
sqlite3_randomness(15, &zBuf[j]);
for(i=0; i<15; i++, j++){