diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-15 17:33:43 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-15 17:33:43 +0100 |
commit | 678b53baba037dc9c58cb6f39a9ffeeff6f7ee3c (patch) | |
tree | 03aa7dd4e6241a69519a8cf9ba568e68b2ccccaa /Python/sysmodule.c | |
parent | c863d54fbba4643a3c4c8d7244222f4131389993 (diff) | |
download | cpython-678b53baba037dc9c58cb6f39a9ffeeff6f7ee3c.tar.gz |
sysmodule.c: fix sys_update_path(), use Py_ARRAY_LENGTH() to get the size of
the fullpath buffer, not PATH_MAX. fullpath is declared using MAXPATHLEN or
MAX_PATH depending on the OS, and PATH_MAX is not declared on IRIX.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 1a41d2fa71..df9dfb1f0a 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1895,7 +1895,7 @@ sys_update_path(int argc, wchar_t **argv) #else /* All other filename syntaxes */ if (_HAVE_SCRIPT_ARGUMENT(argc, argv)) { #if defined(HAVE_REALPATH) - if (_Py_wrealpath(argv0, fullpath, PATH_MAX)) { + if (_Py_wrealpath(argv0, fullpath, Py_ARRAY_LENGTH(fullpath))) { argv0 = fullpath; } #endif |