summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-15 16:35:31 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-11-15 16:35:31 (GMT)
commit50e01570138109584c7f028554eddac7931197fe (patch)
treed9583834c9af176ed9ea5c0dfdf1196f51105f45 /Python/sysmodule.c
parentb5a7a0aa3f9360a84fd5e96e415af277156d4988 (diff)
parent2384714819751e975f3ee8c5b57ab1f702e25cac (diff)
downloadcpython-50e01570138109584c7f028554eddac7931197fe.zip
cpython-50e01570138109584c7f028554eddac7931197fe.tar.gz
cpython-50e01570138109584c7f028554eddac7931197fe.tar.bz2
(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.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 3ebb6c9..35a0671 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1959,7 +1959,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