Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b11d6cb7
Commit
b11d6cb7
authored
Nov 15, 2013
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fileutils.c: use MAXPATHLEN instead of PATH_MAX
PATH_MAX is not declared on IRIX nor Windows.
parent
23847148
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Python/fileutils.c
Python/fileutils.c
+6
-6
No files found.
Python/fileutils.c
View file @
b11d6cb7
...
@@ -623,7 +623,7 @@ int
...
@@ -623,7 +623,7 @@ int
_Py_wreadlink
(
const
wchar_t
*
path
,
wchar_t
*
buf
,
size_t
bufsiz
)
_Py_wreadlink
(
const
wchar_t
*
path
,
wchar_t
*
buf
,
size_t
bufsiz
)
{
{
char
*
cpath
;
char
*
cpath
;
char
cbuf
[
PATH_MAX
];
char
cbuf
[
MAXPATHLEN
];
wchar_t
*
wbuf
;
wchar_t
*
wbuf
;
int
res
;
int
res
;
size_t
r1
;
size_t
r1
;
...
@@ -633,11 +633,11 @@ _Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t bufsiz)
...
@@ -633,11 +633,11 @@ _Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t bufsiz)
errno
=
EINVAL
;
errno
=
EINVAL
;
return
-
1
;
return
-
1
;
}
}
res
=
(
int
)
readlink
(
cpath
,
cbuf
,
P
ATH_MAX
);
res
=
(
int
)
readlink
(
cpath
,
cbuf
,
P
y_ARRAY_LENGTH
(
cbuf
)
);
PyMem_Free
(
cpath
);
PyMem_Free
(
cpath
);
if
(
res
==
-
1
)
if
(
res
==
-
1
)
return
-
1
;
return
-
1
;
if
(
res
==
P
ATH_MAX
)
{
if
(
res
==
P
y_ARRAY_LENGTH
(
cbuf
)
)
{
errno
=
EINVAL
;
errno
=
EINVAL
;
return
-
1
;
return
-
1
;
}
}
...
@@ -669,7 +669,7 @@ _Py_wrealpath(const wchar_t *path,
...
@@ -669,7 +669,7 @@ _Py_wrealpath(const wchar_t *path,
wchar_t
*
resolved_path
,
size_t
resolved_path_size
)
wchar_t
*
resolved_path
,
size_t
resolved_path_size
)
{
{
char
*
cpath
;
char
*
cpath
;
char
cresolved_path
[
PATH_MAX
];
char
cresolved_path
[
MAXPATHLEN
];
wchar_t
*
wresolved_path
;
wchar_t
*
wresolved_path
;
char
*
res
;
char
*
res
;
size_t
r
;
size_t
r
;
...
@@ -709,11 +709,11 @@ _Py_wgetcwd(wchar_t *buf, size_t size)
...
@@ -709,11 +709,11 @@ _Py_wgetcwd(wchar_t *buf, size_t size)
#ifdef MS_WINDOWS
#ifdef MS_WINDOWS
return
_wgetcwd
(
buf
,
size
);
return
_wgetcwd
(
buf
,
size
);
#else
#else
char
fname
[
PATH_MAX
];
char
fname
[
MAXPATHLEN
];
wchar_t
*
wname
;
wchar_t
*
wname
;
size_t
len
;
size_t
len
;
if
(
getcwd
(
fname
,
P
ATH_MAX
)
==
NULL
)
if
(
getcwd
(
fname
,
P
y_ARRAY_LENGTH
(
fname
)
)
==
NULL
)
return
NULL
;
return
NULL
;
wname
=
_Py_char2wchar
(
fname
,
&
len
);
wname
=
_Py_char2wchar
(
fname
,
&
len
);
if
(
wname
==
NULL
)
if
(
wname
==
NULL
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment