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
ed53782e
Commit
ed53782e
authored
Dec 13, 2015
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #25846: Fix usage of Py_ARRAY_LENGTH() in win32_wchdir()
parent
8de795f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Modules/posixmodule.c
Modules/posixmodule.c
+3
-3
No files found.
Modules/posixmodule.c
View file @
ed53782e
...
...
@@ -1345,13 +1345,13 @@ win32_chdir(LPCSTR path)
static
BOOL
__stdcall
win32_wchdir
(
LPCWSTR
path
)
{
wchar_t
_new_path
[
MAX_PATH
],
*
new_path
=
_new_path
;
wchar_t
path_buf
[
MAX_PATH
],
*
new_path
=
path_buf
;
int
result
;
wchar_t
env
[
4
]
=
L"=x:"
;
if
(
!
SetCurrentDirectoryW
(
path
))
return
FALSE
;
result
=
GetCurrentDirectoryW
(
Py_ARRAY_LENGTH
(
new_path
),
new_path
);
result
=
GetCurrentDirectoryW
(
Py_ARRAY_LENGTH
(
path_buf
),
new_path
);
if
(
!
result
)
return
FALSE
;
if
(
result
>
Py_ARRAY_LENGTH
(
new_path
))
{
...
...
@@ -1372,7 +1372,7 @@ win32_wchdir(LPCWSTR path)
return
TRUE
;
env
[
1
]
=
new_path
[
0
];
result
=
SetEnvironmentVariableW
(
env
,
new_path
);
if
(
new_path
!=
_new_path
)
if
(
new_path
!=
path_buf
)
PyMem_RawFree
(
new_path
);
return
result
;
}
...
...
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