Skip to content

Instantly share code, notes, and snippets.

@cigumo
Created January 10, 2018 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cigumo/840575d91c7479c1dd18f28c569de05e to your computer and use it in GitHub Desktop.
Save cigumo/840575d91c7479c1dd18f28c569de05e to your computer and use it in GitHub Desktop.
physfs doMkdir patch to allow creating dirs when symlinks are part of the path
modified love/src/jni/physfs-2.1.0/src/physfs.c
@@ -2014,7 +2014,8 @@ static int doMkdir(const char *_dname, char *dname)
const int rc = h->funcs->stat(h->opaque, dname, &statbuf);
if ((!rc) && (currentErrorCode() == PHYSFS_ERR_NOT_FOUND))
exists = 0;
- retval = ((rc) && (statbuf.filetype == PHYSFS_FILETYPE_DIRECTORY));
+ retval = ((rc) && (statbuf.filetype == PHYSFS_FILETYPE_DIRECTORY ||
+ (allowSymLinks && statbuf.filetype == PHYSFS_FILETYPE_SYMLINK)));
} /* if */
if (!exists)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment