]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Cleaner code and additional comments on the handling of 8+3 filenames when
authordrh <drh@noemail.net>
Thu, 3 Dec 2015 20:42:28 +0000 (20:42 +0000)
committerdrh <drh@noemail.net>
Thu, 3 Dec 2015 20:42:28 +0000 (20:42 +0000)
trying to find the name of a database file based on its journal filename,
in the unix VFS.

FossilOrigin-Name: 9e489a71f2aeb1f13f9ca6f106b9144d07ca25aa

manifest
manifest.uuid
src/os_unix.c

index c5398fbecade051d87aabb60ca118cdafe875ff4..ce05de0d3c91d42136582cb6cedfa28c8f6e2e23 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Make\sthe\ssqlite3_status64(),\ssqlite3_strlike(),\sand\nsqlite3_db_cacheflush()\sAPIs\savailable\sto\sloadable\sextensions.
-D 2015-12-03T13:43:07.848
+C Cleaner\scode\sand\sadditional\scomments\son\sthe\shandling\sof\s8+3\sfilenames\swhen\ntrying\sto\sfind\sthe\sname\sof\sa\sdatabase\sfile\sbased\son\sits\sjournal\sfilename,\s\nin\sthe\sunix\sVFS.
+D 2015-12-03T20:42:28.920
 F Makefile.in 28bcd6149e050dff35d4dcfd97e890cd387a499d
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc e8fdca1cb89a1b58b5f4d3a130ea9a3d28cb314d
@@ -323,7 +323,7 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8
 F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
 F src/os_common.h abdb9a191a367793268fe553d25bab894e986a0e
 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
-F src/os_unix.c 60997373a8d90bd17e1c0e49d11ef361b713439b
+F src/os_unix.c 2563734669b06432cea640cbb4f7e9d543f227b9
 F src/os_win.c 386fba30419e8458b13209781c2af5590eab2811
 F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
 F src/pager.c f92aacd5216d8815136c9e0190041783c602641a
@@ -1408,7 +1408,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P d96de532cc4a192cfebae900701dcee0a7d29273
-R ea1163e38de91a0ef50bee8a60cd0c9a
+P a78e865607194718e2ef958879dbf549ac3c9970
+R 2562256032b891190294739fad90243c
 U drh
-Z 21e053713b9d8cfc5b99a96ebe62cd3d
+Z b2f15a80162f9f125f88e21b8ca96ffa
index 619e0d1a546b4511e89dbf12393e85f5026d65c9..2df7d425e622d4243befc2dfa35d9f7620e8e9f2 100644 (file)
@@ -1 +1 @@
-a78e865607194718e2ef958879dbf549ac3c9970
\ No newline at end of file
+9e489a71f2aeb1f13f9ca6f106b9144d07ca25aa
\ No newline at end of file
index 5f4cbca2aac84bb7a135eae46c255381686a6965..beaac0d15d255bdc38240413beac3a8347a38f33 100644 (file)
@@ -5521,16 +5521,19 @@ static int findCreateFileMode(
     ** used by the test_multiplex.c module.
     */
     nDb = sqlite3Strlen30(zPath) - 1; 
-#ifdef SQLITE_ENABLE_8_3_NAMES
-    while( nDb>0 && sqlite3Isalnum(zPath[nDb]) ) nDb--;
-    if( nDb==0 || zPath[nDb]!='-' ) return SQLITE_OK;
-#else
     while( zPath[nDb]!='-' ){
+#ifndef SQLITE_ENABLE_8_3_NAMES
+      /* In the normal case (8+3 filenames disabled) the journal filename
+      ** is guaranteed to contain a '-' character. */
       assert( nDb>0 );
-      assert( zPath[nDb]!='\n' );
+      assert( sqlite3Isalnum(zPath[nDb]) );
+#else
+      /* If 8+3 names are possible, then the journal file might not contain
+      ** a '-' character.  So check for that case and return early. */
+      if( nDb==0 || zPath[nDb]=='.' ) return SQLITE_OK;
+#endif
       nDb--;
     }
-#endif
     memcpy(zDb, zPath, nDb);
     zDb[nDb] = '\0';