1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

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
This commit is contained in:
drh
2011-10-05 15:26:13 +00:00
parent d4b0ff9926
commit c47167a6a8
3 changed files with 17 additions and 9 deletions

View File

@@ -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';