1
# DP: Replace PATH_MAX with MAXPATHLEN.
3
1
--- a/Python/pythonrun.c
4
2
+++ b/Python/pythonrun.c
8
static wchar_t *default_home = NULL;
9
-static wchar_t env_home[PATH_MAX+1];
10
+static wchar_t env_home[MAXPATHLEN+1];
13
Py_SetPythonHome(wchar_t *home)
15
if (home == NULL && !Py_IgnoreEnvironmentFlag) {
16
char* chome = Py_GETENV("PYTHONHOME");
18
- size_t r = mbstowcs(env_home, chome, PATH_MAX+1);
19
- if (r != (size_t)-1 && r <= PATH_MAX)
20
+ size_t r = mbstowcs(env_home, chome, MAXPATHLEN+1);
21
+ if (r != (size_t)-1 && r <= MAXPATHLEN)
25
--- a/Python/sysmodule.c
26
+++ b/Python/sysmodule.c
28
#else /* All other filename syntaxes */
29
if (_HAVE_SCRIPT_ARGUMENT(argc, argv)) {
30
#if defined(HAVE_REALPATH)
31
- if (_Py_wrealpath(argv0, fullpath, PATH_MAX)) {
32
+ if (_Py_wrealpath(argv0, fullpath, MAXPATHLEN)) {
4
#define PATH_MAX MAXPATHLEN
36
--- a/Python/fileutils.c
37
+++ b/Python/fileutils.c
39
_Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t bufsiz)
42
- char cbuf[PATH_MAX];
43
+ char cbuf[MAXPATHLEN];
51
- res = (int)readlink(cpath, cbuf, PATH_MAX);
52
+ res = (int)readlink(cpath, cbuf, MAXPATHLEN);
56
- if (res == PATH_MAX) {
57
+ if (res == MAXPATHLEN) {
62
wchar_t *resolved_path, size_t resolved_path_size)
65
- char cresolved_path[PATH_MAX];
66
+ char cresolved_path[MAXPATHLEN];
67
wchar_t *wresolved_path;
72
return _wgetcwd(buf, size);
74
- char fname[PATH_MAX];
75
+ char fname[MAXPATHLEN];
79
- if (getcwd(fname, PATH_MAX) == NULL)
80
+ if (getcwd(fname, MAXPATHLEN) == NULL)
82
wname = _Py_char2wchar(fname, &len);
8
+#define PATH_MAX MAXPATHLEN
12
#define PRINT_TOTAL_REFS()
13
#else /* Py_REF_DEBUG */