From: pweilbacher Date: Wed, 5 Sep 2007 22:28:23 +0000 (+0000) Subject: Fix temp file handling for OS/2 so that trailing slashes or backslashes X-Git-Tag: version-3.6.10~1771 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5056b41c1fc4566df38729a14d2239335e14a969;p=thirdparty%2Fsqlite.git Fix temp file handling for OS/2 so that trailing slashes or backslashes are stripped off the path gotten from the environment. Otherwise full paths might contain multiple slashes which causes opening of files to fail. (CVS 4406) FossilOrigin-Name: 96aa96ac11ab63b51e4322e88ded4f931e1e78c8 --- diff --git a/manifest b/manifest index 5b868feaf9..952f4b5d89 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sharmless\stypo\sin\sthe\sPRNG\sinitialization\son\swin32.\s\sTicket\s#2617.\s(CVS\s4405) -D 2007-09-05T17:06:03 +C Fix\stemp\sfile\shandling\sfor\sOS/2\sso\sthat\strailing\sslashes\sor\sbackslashes\nare\sstripped\soff\sthe\spath\sgotten\sfrom\sthe\senvironment.\sOtherwise\sfull\npaths\smight\scontain\smultiple\sslashes\swhich\scauses\sopening\sof\sfiles\sto\nfail.\s(CVS\s4406) +D 2007-09-05T22:28:23 F Makefile.in cbfb898945536a8f9ea8b897e1586dd1fdbcc5db F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -112,7 +112,7 @@ F src/mutex_w32.c d2c56fb81aca10af1577bdae2a4083eb2505f8ee F src/os.c 198c6c55cbdbe5b9c3105070c88fcc077d1b2447 F src/os.h 53e65427899ed5697d79749d646e6a297b70171a F src/os_common.h 98862f120ca6bf7a48ce8b16f158b77d00bc9d2f -F src/os_os2.c 8769301bff502de642ad2634cedcb77d967ce199 +F src/os_os2.c 5b5f42180c5961b9d207748fda8f9aa0e70569c8 F src/os_os2.h c3f7d0af7e3453d1d7aa81b06c0a56f5a226530b F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 @@ -570,7 +570,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P 80a44382d149b9d53212c15368565ede31aa2dc4 -R b1c9f0cdccf744e448ce6e94fa87f8cd -U drh -Z 156cfe7f3b9b1606282f8d34fdf8a505 +P ea1d76e3fae599f7197f32852f1722b61ae3f8a7 +R 5b31a1ca01a73935ad745691ba7d9c55 +U pweilbacher +Z 42de2c8d32b51dcecffe0766dc9b21eb diff --git a/manifest.uuid b/manifest.uuid index 6b0e6080dd..1b03262de9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ea1d76e3fae599f7197f32852f1722b61ae3f8a7 \ No newline at end of file +96aa96ac11ab63b51e4322e88ded4f931e1e78c8 \ No newline at end of file diff --git a/src/os_os2.c b/src/os_os2.c index 66f19fb460..c4fbe66d47 100644 --- a/src/os_os2.c +++ b/src/os_os2.c @@ -238,6 +238,13 @@ int sqlite3Os2TempFileName( char *zBuf ){ } } } + /* strip off a trailing slashes or backslashes, otherwise we would get * + * multiple (back)slashes which causes DosOpen() to fail */ + j = strlen(zTempPath); + while( j > 0 && zTempPath[j-1] == '\\' || zTempPath[j-1] == '/' ){ + j--; + } + zTempPath[j] = '\0'; for(;;){ sprintf( zBuf, "%s\\"TEMP_FILE_PREFIX, zTempPath ); j = strlen( zBuf );