Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
db65e4f5
Commit
db65e4f5
authored
Mar 26, 2013
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for Windows XP
parent
bfac7d63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
libmysql/get_password.c
libmysql/get_password.c
+8
-7
No files found.
libmysql/get_password.c
View file @
db65e4f5
...
...
@@ -62,12 +62,13 @@
/* were just going to fake it here and get input from the keyboard */
void
get_tty_password_buff
(
const
char
*
opt_message
,
char
*
to
,
size_t
length
)
{
HANDLE
consoleinput
;
HANDLE
consoleinput
;
DWORD
oldstate
;
char
*
pos
=
to
,
*
end
=
to
+
length
-
1
;
int
i
=
0
;
consoleinput
=
CreateFile
(
"CONIN$"
,
GENERIC_WRITE
|
GENERIC_READ
,
0
,
NULL
,
0
,
0
,
NULL
);
consoleinput
=
CreateFile
(
"CONIN$"
,
GENERIC_WRITE
|
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
consoleinput
==
NULL
||
consoleinput
==
INVALID_HANDLE_VALUE
)
{
/* This is a GUI application or service without console input, bail out. */
...
...
@@ -76,11 +77,11 @@ void get_tty_password_buff(const char *opt_message, char *to, size_t length)
}
_cputs
(
opt_message
?
opt_message
:
"Enter password: "
);
/*
Switch to raw mode (no line input, no echo input).
Allow Ctrl-C handler with ENABLE_PROCESSED_INPUT.
*/
GetConsoleMode
(
consoleinput
,
&
oldstate
);
/*
Switch to raw mode (no line input, no echo input).
Allow Ctrl-C handler with ENABLE_PROCESSED_INPUT.
*/
GetConsoleMode
(
consoleinput
,
&
oldstate
);
SetConsoleMode
(
consoleinput
,
ENABLE_PROCESSED_INPUT
);
for
(;;)
{
...
...
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