Skip to content

Commit b70fd54

Browse files
committed
Don't set real_executable if readlink returns an empty string
Signed-off-by: Filipe Laíns <lains@riseup.net>
1 parent e9b4131 commit b70fd54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/getpath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ progname_to_dict(PyObject *dict, const char *key)
799799
}
800800
#elif defined(HAVE_READLINK)
801801
wchar_t resolved[MAXPATHLEN + 1];
802-
if (_Py_wreadlink(L"/proc/self/exe", resolved, Py_ARRAY_LENGTH(resolved)) != -1) {
802+
if (_Py_wreadlink(L"/proc/self/exe", resolved, Py_ARRAY_LENGTH(resolved)) > 0) {
803803
return wchar_to_dict(dict, key, resolved);
804804
}
805805
#endif

0 commit comments

Comments
 (0)