diff Python/sysmodule.c @ 87116:f39fac22ca9a

(Merge 3.3) 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.
author Victor Stinner <victor.stinner@gmail.com>
date Fri, 15 Nov 2013 17:35:31 +0100
parents 01c4a0af73cf 780a0199c7f1
children adb471b9cba1
line wrap: on
line diff
--- a/Python/sysmodule.c	Fri Nov 15 17:12:14 2013 +0100
+++ b/Python/sysmodule.c	Fri Nov 15 17:35:31 2013 +0100
@@ -1959,7 +1959,7 @@
 #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