Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d3a48ee3
Commit
d3a48ee3
authored
Jul 31, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Only check for flag presence in isatty function.
parent
3cf2fb3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
17 deletions
+19
-17
file.c
dlls/msvcrt/file.c
+19
-17
No files found.
dlls/msvcrt/file.c
View file @
d3a48ee3
...
...
@@ -65,7 +65,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
#define WX_PIPE 0x08
#define WX_DONTINHERIT 0x10
#define WX_APPEND 0x20
#define WX_
NOSEEK
0x40
#define WX_
TTY
0x40
#define WX_TEXT 0x80
/* values for exflag - it's used differently in msvcr90.dll*/
...
...
@@ -376,7 +376,7 @@ static int msvcrt_set_fd(HANDLE hand, int flag, int fd)
}
fdinfo
->
handle
=
hand
;
fdinfo
->
wxflag
=
WX_OPEN
|
(
flag
&
(
WX_DONTINHERIT
|
WX_APPEND
|
WX_TEXT
|
WX_PIPE
|
WX_
NOSEEK
));
fdinfo
->
wxflag
=
WX_OPEN
|
(
flag
&
(
WX_DONTINHERIT
|
WX_APPEND
|
WX_TEXT
|
WX_PIPE
|
WX_
TTY
));
fdinfo
->
lookahead
[
0
]
=
'\n'
;
fdinfo
->
lookahead
[
1
]
=
'\n'
;
fdinfo
->
lookahead
[
2
]
=
'\n'
;
...
...
@@ -550,7 +550,7 @@ void msvcrt_init_io(void)
HANDLE
h
=
GetStdHandle
(
STD_INPUT_HANDLE
);
DWORD
type
=
GetFileType
(
h
);
msvcrt_set_fd
(
h
,
WX_OPEN
|
WX_TEXT
|
((
type
&
0xf
)
==
FILE_TYPE_CHAR
?
WX_
NOSEEK
:
0
)
msvcrt_set_fd
(
h
,
WX_OPEN
|
WX_TEXT
|
((
type
&
0xf
)
==
FILE_TYPE_CHAR
?
WX_
TTY
:
0
)
|
((
type
&
0xf
)
==
FILE_TYPE_PIPE
?
WX_PIPE
:
0
),
MSVCRT_STDIN_FILENO
);
}
...
...
@@ -559,7 +559,7 @@ void msvcrt_init_io(void)
HANDLE
h
=
GetStdHandle
(
STD_OUTPUT_HANDLE
);
DWORD
type
=
GetFileType
(
h
);
msvcrt_set_fd
(
h
,
WX_OPEN
|
WX_TEXT
|
((
type
&
0xf
)
==
FILE_TYPE_CHAR
?
WX_
NOSEEK
:
0
)
msvcrt_set_fd
(
h
,
WX_OPEN
|
WX_TEXT
|
((
type
&
0xf
)
==
FILE_TYPE_CHAR
?
WX_
TTY
:
0
)
|
((
type
&
0xf
)
==
FILE_TYPE_PIPE
?
WX_PIPE
:
0
),
MSVCRT_STDOUT_FILENO
);
}
...
...
@@ -568,7 +568,7 @@ void msvcrt_init_io(void)
HANDLE
h
=
GetStdHandle
(
STD_ERROR_HANDLE
);
DWORD
type
=
GetFileType
(
h
);
msvcrt_set_fd
(
h
,
WX_OPEN
|
WX_TEXT
|
((
type
&
0xf
)
==
FILE_TYPE_CHAR
?
WX_
NOSEEK
:
0
)
msvcrt_set_fd
(
h
,
WX_OPEN
|
WX_TEXT
|
((
type
&
0xf
)
==
FILE_TYPE_CHAR
?
WX_
TTY
:
0
)
|
((
type
&
0xf
)
==
FILE_TYPE_PIPE
?
WX_PIPE
:
0
),
MSVCRT_STDERR_FILENO
);
}
...
...
@@ -607,13 +607,9 @@ static int msvcrt_flush_buffer(MSVCRT_FILE* file)
*/
int
CDECL
MSVCRT__isatty
(
int
fd
)
{
HANDLE
hand
=
msvcrt_fdtoh
(
fd
);
TRACE
(
":fd (%d)
\n
"
,
fd
);
TRACE
(
":fd (%d) handle (%p)
\n
"
,
fd
,
hand
);
if
(
hand
==
INVALID_HANDLE_VALUE
)
return
0
;
return
GetFileType
(
hand
)
==
FILE_TYPE_CHAR
?
1
:
0
;
return
msvcrt_get_ioinfo
(
fd
)
->
wxflag
&
WX_TTY
;
}
/* INTERNAL: Allocate stdio file buffer */
...
...
@@ -2006,7 +2002,7 @@ int CDECL MSVCRT__wsopen_s( int *fd, const MSVCRT_wchar_t* path, int oflags, int
{
DWORD
access
=
0
,
creation
=
0
,
attrib
;
SECURITY_ATTRIBUTES
sa
;
DWORD
sharing
;
DWORD
sharing
,
type
;
int
wxflag
;
HANDLE
hand
;
...
...
@@ -2139,6 +2135,12 @@ int CDECL MSVCRT__wsopen_s( int *fd, const MSVCRT_wchar_t* path, int oflags, int
oflags
=
check_bom
(
hand
,
oflags
,
TRUE
);
}
type
=
GetFileType
(
hand
);
if
(
type
==
FILE_TYPE_CHAR
)
wxflag
|=
WX_TTY
;
else
if
(
type
==
FILE_TYPE_PIPE
)
wxflag
|=
WX_PIPE
;
*
fd
=
msvcrt_alloc_fd
(
hand
,
wxflag
);
if
(
*
fd
==
-
1
)
return
*
MSVCRT__errno
();
...
...
@@ -2300,7 +2302,7 @@ int CDECL MSVCRT__open_osfhandle(MSVCRT_intptr_t handle, int oflags)
}
if
(
flags
==
FILE_TYPE_CHAR
)
flags
=
WX_
NOSEEK
;
flags
=
WX_
TTY
;
else
if
(
flags
==
FILE_TYPE_PIPE
)
flags
=
WX_PIPE
;
else
...
...
@@ -2424,7 +2426,7 @@ static int read_utf8(int fd, MSVCRT_wchar_t *buf, unsigned int count)
buf
[
0
]
=
'\n'
;
else
{
buf
[
0
]
=
'\r'
;
if
(
fdinfo
->
wxflag
&
(
WX_PIPE
|
WX_
NOSEEK
))
if
(
fdinfo
->
wxflag
&
(
WX_PIPE
|
WX_
TTY
))
fdinfo
->
lookahead
[
0
]
=
lookahead
;
else
SetFilePointer
(
fdinfo
->
handle
,
-
1
,
NULL
,
FILE_CURRENT
);
...
...
@@ -2472,7 +2474,7 @@ static int read_utf8(int fd, MSVCRT_wchar_t *buf, unsigned int count)
if
(
char_len
+
i
<=
pos
)
i
+=
char_len
;
if
(
fdinfo
->
wxflag
&
(
WX_PIPE
|
WX_
NOSEEK
))
{
if
(
fdinfo
->
wxflag
&
(
WX_PIPE
|
WX_
TTY
))
{
if
(
i
<
pos
)
fdinfo
->
lookahead
[
0
]
=
readbuf
[
i
];
if
(
i
+
1
<
pos
)
...
...
@@ -2500,7 +2502,7 @@ static int read_utf8(int fd, MSVCRT_wchar_t *buf, unsigned int count)
if
(
lookahead
!=
'\n'
)
readbuf
[
j
++
]
=
'\r'
;
if
(
fdinfo
->
wxflag
&
(
WX_PIPE
|
WX_
NOSEEK
))
if
(
fdinfo
->
wxflag
&
(
WX_PIPE
|
WX_
TTY
))
fdinfo
->
lookahead
[
0
]
=
lookahead
;
else
SetFilePointer
(
fdinfo
->
handle
,
-
1
,
NULL
,
FILE_CURRENT
);
...
...
@@ -2634,7 +2636,7 @@ static int read_i(int fd, void *buf, unsigned int count)
if
(
utf16
)
bufstart
[
j
++
]
=
0
;
}
if
(
fdinfo
->
wxflag
&
(
WX_PIPE
|
WX_
NOSEEK
))
if
(
fdinfo
->
wxflag
&
(
WX_PIPE
|
WX_
TTY
))
{
if
(
lookahead
[
0
]
==
'\n'
&&
(
!
utf16
||
!
lookahead
[
1
]))
{
...
...
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