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
ed29bb49
Commit
ed29bb49
authored
Nov 08, 2008
by
Hirokazu Yamamoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #4071: ntpath.abspath returned an empty string for long unicode path.
parent
3d6f8ff8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
Modules/posixmodule.c
Modules/posixmodule.c
+20
-6
No files found.
Modules/posixmodule.c
View file @
ed29bb49
...
@@ -2389,13 +2389,27 @@ posix__getfullpathname(PyObject *self, PyObject *args)
...
@@ -2389,13 +2389,27 @@ posix__getfullpathname(PyObject *self, PyObject *args)
if
(
unicode_file_names
())
{
if
(
unicode_file_names
())
{
PyUnicodeObject
*
po
;
PyUnicodeObject
*
po
;
if
(
PyArg_ParseTuple
(
args
,
"U|:_getfullpathname"
,
&
po
))
{
if
(
PyArg_ParseTuple
(
args
,
"U|:_getfullpathname"
,
&
po
))
{
Py_UNICODE
woutbuf
[
MAX_PATH
*
2
];
Py_UNICODE
*
wpath
=
PyUnicode_AS_UNICODE
(
po
);
Py_UNICODE
woutbuf
[
MAX_PATH
*
2
],
*
woutbufp
=
woutbuf
;
Py_UNICODE
*
wtemp
;
Py_UNICODE
*
wtemp
;
if
(
!
GetFullPathNameW
(
PyUnicode_AS_UNICODE
(
po
),
DWORD
result
;
sizeof
(
woutbuf
)
/
sizeof
(
woutbuf
[
0
]),
PyObject
*
v
;
woutbuf
,
&
wtemp
))
result
=
GetFullPathNameW
(
wpath
,
return
win32_error
(
"GetFullPathName"
,
""
);
sizeof
(
woutbuf
)
/
sizeof
(
woutbuf
[
0
]),
return
PyUnicode_FromUnicode
(
woutbuf
,
wcslen
(
woutbuf
));
woutbuf
,
&
wtemp
);
if
(
result
>
sizeof
(
woutbuf
)
/
sizeof
(
woutbuf
[
0
]))
{
woutbufp
=
malloc
(
result
*
sizeof
(
Py_UNICODE
));
if
(
!
woutbufp
)
return
PyErr_NoMemory
();
result
=
GetFullPathNameW
(
wpath
,
result
,
woutbufp
,
&
wtemp
);
}
if
(
result
)
v
=
PyUnicode_FromUnicode
(
woutbufp
,
wcslen
(
woutbufp
));
else
v
=
win32_error_unicode
(
"GetFullPathNameW"
,
wpath
);
if
(
woutbufp
!=
woutbuf
)
free
(
woutbufp
);
return
v
;
}
}
/* Drop the argument parsing error as narrow strings
/* Drop the argument parsing error as narrow strings
are also valid. */
are also valid. */
...
...
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