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
a7e16488
Commit
a7e16488
authored
Feb 04, 2017
by
Steve Dower
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds precheck for console filename to fix Windows 7.
parent
6f805628
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
Modules/_io/winconsoleio.c
Modules/_io/winconsoleio.c
+13
-1
No files found.
Modules/_io/winconsoleio.c
View file @
a7e16488
...
@@ -86,6 +86,19 @@ char _PyIO_get_console_type(PyObject *path_or_fd) {
...
@@ -86,6 +86,19 @@ char _PyIO_get_console_type(PyObject *path_or_fd) {
return
'\0'
;
return
'\0'
;
}
}
char
m
=
'\0'
;
if
(
!
_wcsicmp
(
decoded_wstr
,
L"CONIN$"
))
{
m
=
'r'
;
}
else
if
(
!
_wcsicmp
(
decoded_wstr
,
L"CONOUT$"
))
{
m
=
'w'
;
}
else
if
(
!
_wcsicmp
(
decoded_wstr
,
L"CON"
))
{
m
=
'x'
;
}
if
(
m
)
{
PyMem_Free
(
decoded_wstr
);
return
m
;
}
DWORD
length
;
DWORD
length
;
wchar_t
name_buf
[
MAX_PATH
],
*
pname_buf
=
name_buf
;
wchar_t
name_buf
[
MAX_PATH
],
*
pname_buf
=
name_buf
;
...
@@ -99,7 +112,6 @@ char _PyIO_get_console_type(PyObject *path_or_fd) {
...
@@ -99,7 +112,6 @@ char _PyIO_get_console_type(PyObject *path_or_fd) {
}
}
PyMem_Free
(
decoded_wstr
);
PyMem_Free
(
decoded_wstr
);
char
m
=
'\0'
;
if
(
length
)
{
if
(
length
)
{
wchar_t
*
name
=
pname_buf
;
wchar_t
*
name
=
pname_buf
;
if
(
length
>=
4
&&
name
[
3
]
==
L'\\'
&&
if
(
length
>=
4
&&
name
[
3
]
==
L'\\'
&&
...
...
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