diff options
author | drh <drh@noemail.net> | 2011-10-05 15:26:13 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2011-10-05 15:26:13 +0000 |
commit | c47167a6a887e09e627c10e10aa600183925f68d (patch) | |
tree | 687a90e98cb96fd3c53ac87f6e31f5ad06f7a22d /src/os_unix.c | |
parent | d4b0ff9926371712e234762ed01df3d7e712f1d7 (diff) | |
download | sqlite-c47167a6a887e09e627c10e10aa600183925f68d.tar.gz sqlite-c47167a6a887e09e627c10e10aa600183925f68d.zip |
When finding the appropriate file permissions for journal files with
SQLITE_ENABLE_8_3_NAMES, ignore "-" characters in the name of the
containing directory.
FossilOrigin-Name: 328cc1867ffbbf1c953dfd843649f5f209c8e6ec
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index d85a7949b..a23a76234 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -4888,8 +4888,16 @@ static int findCreateFileMode( ** used by the test_multiplex.c module. */ nDb = sqlite3Strlen30(zPath) - 1; - while( nDb>0 && zPath[nDb]!='-' ) nDb--; - if( nDb==0 ) return SQLITE_OK; +#ifdef SQLITE_ENABLE_8_3_NAMES + while( nDb>0 && zPath[nDb]!='-' && zPath[nDb]!='/' ) nDb--; + if( nDb==0 || zPath[nDb]=='/' ) return SQLITE_OK; +#else + while( zPath[nDb]!='-' ){ + assert( nDb>0 ); + assert( zPath[nDb]!='\n' ); + nDb--; + } +#endif memcpy(zDb, zPath, nDb); zDb[nDb] = '\0'; |