Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f9fb40e5
Commit
f9fb40e5
authored
Oct 29, 2005
by
Kevin Koltzau
Committed by
Alexandre Julliard
Oct 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable line editing for _cgets.
parent
52c62995
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
10 deletions
+27
-10
console.c
dlls/msvcrt/console.c
+27
-10
No files found.
dlls/msvcrt/console.c
View file @
f9fb40e5
...
@@ -156,19 +156,36 @@ int _getche(void)
...
@@ -156,19 +156,36 @@ int _getche(void)
char
*
_cgets
(
char
*
str
)
char
*
_cgets
(
char
*
str
)
{
{
char
*
buf
=
str
+
2
;
char
*
buf
=
str
+
2
;
int
c
;
DWORD
got
;
DWORD
conmode
=
0
;
TRACE
(
"(%p)
\n
"
,
str
);
str
[
1
]
=
0
;
/* Length */
str
[
1
]
=
0
;
/* Length */
/* FIXME: No editing of string supported */
LOCK_CONSOLE
;
LOCK_CONSOLE
;
do
GetConsoleMode
(
MSVCRT_console_in
,
&
conmode
);
{
SetConsoleMode
(
MSVCRT_console_in
,
ENABLE_LINE_INPUT
|
ENABLE_ECHO_INPUT
|
ENABLE_PROCESSED_INPUT
);
if
(
str
[
1
]
>=
str
[
0
]
||
(
str
[
1
]
++
,
c
=
_getche
())
==
MSVCRT_EOF
||
c
==
'\n'
)
break
;
if
(
ReadConsoleA
(
MSVCRT_console_in
,
buf
,
str
[
0
],
&
got
,
NULL
))
{
*
buf
++
=
c
&
0xff
;
if
(
buf
[
got
-
2
]
==
'\r'
)
{
}
while
(
1
);
buf
[
got
-
2
]
=
0
;
str
[
1
]
=
got
-
2
;
}
else
if
(
got
==
1
&&
buf
[
got
-
1
]
==
'\n'
)
{
buf
[
0
]
=
0
;
str
[
1
]
=
0
;
}
else
if
(
got
==
str
[
0
]
&&
buf
[
got
-
1
]
==
'\r'
)
{
buf
[
got
-
1
]
=
0
;
str
[
1
]
=
got
-
1
;
}
else
str
[
1
]
=
got
;
}
else
buf
=
NULL
;
SetConsoleMode
(
MSVCRT_console_in
,
conmode
);
UNLOCK_CONSOLE
;
UNLOCK_CONSOLE
;
*
buf
=
'\0'
;
return
buf
;
return
str
+
2
;
}
}
/*********************************************************************
/*********************************************************************
...
...
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