diff options
author | Steve Dower <steve.dower@microsoft.com> | 2015-05-23 17:34:50 -0700 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2015-05-23 17:34:50 -0700 |
commit | 2bf71f72aed9b46b3a75d6a6aeaef9305b2c19e2 (patch) | |
tree | 43d9a275c05f431d4f1fa1d64142772b1ab83728 /PC | |
parent | 9cfc0d56b141661a10be7535fbb50d83d4a54cee (diff) | |
download | cpython-2bf71f72aed9b46b3a75d6a6aeaef9305b2c19e2.tar.gz |
Fixes handling of long values of PYTHONPATH on Windows.
Diffstat (limited to 'PC')
-rw-r--r-- | PC/getpathp.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c index 08b65c5ed2..25b328b260 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -620,21 +620,21 @@ calculate_path(void) if (*p == DELIM) bufsz++; /* number of DELIM plus one */ } - bufsz *= wcsnlen_s(pythonhome, MAXPATHLEN+1); + bufsz *= wcslen(pythonhome); } else bufsz = 0; - bufsz += wcsnlen_s(PYTHONPATH, MAXPATHLEN+1) + 1; - bufsz += wcsnlen_s(argv0_path, MAXPATHLEN+1) + 1; + bufsz += wcslen(PYTHONPATH) + 1; + bufsz += wcslen(argv0_path) + 1; #ifdef MS_WINDOWS if (!applocal && userpath) - bufsz += wcsnlen_s(userpath, MAXPATHLEN+1) + 1; + bufsz += wcslen(userpath) + 1; if (!applocal && machinepath) - bufsz += wcsnlen_s(machinepath, MAXPATHLEN+1) + 1; - bufsz += wcsnlen_s(zip_path, MAXPATHLEN+1) + 1; + bufsz += wcslen(machinepath) + 1; + bufsz += wcslen(zip_path) + 1; #endif if (envpath != NULL) - bufsz += wcsnlen_s(envpath, MAXPATHLEN+1) + 1; + bufsz += wcslen(envpath) + 1; module_search_path = buf = PyMem_RawMalloc(bufsz*sizeof(wchar_t)); if (buf == NULL) { |