]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
On Windows, when no temporary path is available, skip prepending the directory separator.
authormistachkin <mistachkin@noemail.net>
Sun, 18 Mar 2012 03:22:44 +0000 (03:22 +0000)
committermistachkin <mistachkin@noemail.net>
Sun, 18 Mar 2012 03:22:44 +0000 (03:22 +0000)
FossilOrigin-Name: 32b5c20e54474fcc33ba937293e97566a555e733

manifest
manifest.uuid
src/os_win.c

index f939c80f9c214a8c154e1553c5d370f2b58658ef..c266353f34878b24e659575dcb4aff61ffbbeff0 100644 (file)
--- a/manifest
+++ b/manifest
@@ -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
index e165bcff85cfd538466ff06221ba0a18382d85a6..d004dba128fe2c42848b8992d7e81a7dd5d2dab4 100644 (file)
@@ -1 +1 @@
-1ae9f9e4f730eccbc0fc3408de1ac3c4be931e01
\ No newline at end of file
+32b5c20e54474fcc33ba937293e97566a555e733
\ No newline at end of file
index 21deea559902ba7da4bd4a24aadc9794ee273b62..57f42b7af36a90bd8e693377c51ed7aae03cb848 100644 (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++){