master 7fe7a2635bf: Fix `openp' for some manners of invocations on Android
Po Lu via Mailing list for Emacs changes <[email protected]>
| Newsgroups | gmane.emacs.diffs |
|---|---|
| Message-ID | <[email protected]> |
branch: master commit 7fe7a2635bf170fcd106f944f255e3c9ce99123f Author: Po Lu <[email protected]> Commit: Po Lu <[email protected]> Fix `openp' for some manners of invocations on Android * src/lread.c (openp) [USE_ANDROID_ASSETS]: Don't write file name to *STOREPTR if NULL and call SAFE_FREE before yielding platform file descriptor. --- src/lread.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/lread.c b/src/lread.c index 48d2420f96e..72791bdc80f 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1950,8 +1950,16 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, if (platform_fd.asset && platform_fd.asset != (void *) -1) { - *storeptr = string; - goto handle_platform_fd; + /* Here, openp found a platform specific + file descriptor. It can't be a directory + under Android, so return it in *PLATFORM + and then indicate this by returning -3 + for the file descriptor. */ + if (storeptr) + *storeptr = string; + *platform = platform_fd.asset; + SAFE_FREE (); + return -3; } if (platform_fd.asset == (void *) -1) @@ -2030,16 +2038,6 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, SAFE_FREE (); errno = last_errno; return -1; - -#ifdef USE_ANDROID_ASSETS - handle_platform_fd: - - /* Here, openp found a platform specific file descriptor. It can't - be a directory under Android, so return it in *PLATFORM and then - -3 as the file descriptor. */ - *platform = platform_fd.asset; - return -3; -#endif }