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
8bc6e004
Commit
8bc6e004
authored
Feb 20, 2000
by
Marcus Meissner
Committed by
Alexandre Julliard
Feb 20, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a bit magic to CONSOLE_get_input so we don't get single Escapes
from function key escape sequences.
parent
bcb7f4ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
console.c
win32/console.c
+20
-2
No files found.
win32/console.c
View file @
8bc6e004
...
@@ -245,18 +245,36 @@ static void
...
@@ -245,18 +245,36 @@ static void
CONSOLE_get_input
(
HANDLE
handle
,
BOOL
blockwait
)
CONSOLE_get_input
(
HANDLE
handle
,
BOOL
blockwait
)
{
{
char
*
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
1
);
char
*
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
1
);
int
len
=
0
;
int
len
=
0
,
escape_seen
=
0
;
while
(
1
)
while
(
1
)
{
{
DWORD
res
;
DWORD
res
;
char
inchar
;
char
inchar
;
if
(
WaitForSingleObject
(
handle
,
0
))
break
;
/* If we have at one time seen escape in this loop, we are
* within an Escape sequence, so wait for a bit more input for the
* rest of the loop.
*/
if
(
WaitForSingleObject
(
handle
,
escape_seen
*
10
))
break
;
if
(
!
ReadFile
(
handle
,
&
inchar
,
1
,
&
res
,
NULL
))
break
;
if
(
!
ReadFile
(
handle
,
&
inchar
,
1
,
&
res
,
NULL
))
break
;
if
(
!
res
)
/* res 0 but readable means EOF? Hmm. */
if
(
!
res
)
/* res 0 but readable means EOF? Hmm. */
break
;
break
;
buf
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
buf
,
len
+
1
);
buf
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
buf
,
len
+
1
);
buf
[
len
++
]
=
inchar
;
buf
[
len
++
]
=
inchar
;
if
(
inchar
==
27
)
{
if
(
len
>
1
)
{
/* If we spot an ESC, we flush all up to it
* since we can be sure that we have a complete
* sequence.
*/
CONSOLE_string_to_IR
(
handle
,
buf
,
len
-
1
);
buf
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
buf
,
1
);
buf
[
0
]
=
27
;
len
=
1
;
}
escape_seen
=
1
;
}
}
}
CONSOLE_string_to_IR
(
handle
,
buf
,
len
);
CONSOLE_string_to_IR
(
handle
,
buf
,
len
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
...
...
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