mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Change the implementation of the unix implementation of xAccess() so that it returns 0 (does not exist) to an SQLITE_ACCESS_EXISTS query on a file that exists but is zero bytes in size.
FossilOrigin-Name: 077b0e5bcd849130c8df373fc2134c4b44351882
This commit is contained in:
@@ -4618,6 +4618,12 @@ static int unixAccess(
|
||||
assert(!"Invalid flags argument");
|
||||
}
|
||||
*pResOut = (access(zPath, amode)==0);
|
||||
if( flags==SQLITE_ACCESS_EXISTS && *pResOut ){
|
||||
struct stat buf;
|
||||
if( 0==stat(zPath, &buf) && buf.st_size==0 ){
|
||||
*pResOut = 0;
|
||||
}
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user