Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP1
physfs
physfs-empty_dir_fix.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File physfs-empty_dir_fix.patch of Package physfs
diff -up physfs-3.0.1/src/physfs.c.orig physfs-3.0.1/src/physfs.c --- physfs-3.0.1/src/physfs.c.orig 2018-10-05 14:58:25.549372371 -0400 +++ physfs-3.0.1/src/physfs.c 2018-10-05 14:59:30.720938234 -0400 @@ -879,13 +879,20 @@ static DirHandle *openDirectory(PHYSFS_I if (io == NULL) { + /* file doesn't exist, etc? Just fail out. */ + PHYSFS_Stat statbuf; + BAIL_IF_ERRPASS(!__PHYSFS_platformStat(d, &statbuf, 1), NULL); + /* DIR gets first shot (unlike the rest, it doesn't deal with files). */ - retval = tryOpenDir(io, &__PHYSFS_Archiver_DIR, d, forWriting, &claimed); - if (retval || claimed) - return retval; + if (statbuf.filetype == PHYSFS_FILETYPE_DIRECTORY) + { + retval = tryOpenDir(io, &__PHYSFS_Archiver_DIR, d, forWriting, &claimed); + if (retval || claimed) + return retval; + } /* if */ io = __PHYSFS_createNativeIo(d, forWriting ? 'w' : 'r'); - BAIL_IF_ERRPASS(!io, 0); + BAIL_IF_ERRPASS(!io, NULL); created_io = 1; } /* if */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor