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
4b1ef917
Commit
4b1ef917
authored
Mar 13, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Mar 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd.exe: Add SET /P support.
parent
a801995c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
builtins.c
programs/cmd/builtins.c
+33
-2
No files found.
programs/cmd/builtins.c
View file @
4b1ef917
...
...
@@ -1278,11 +1278,42 @@ void WCMD_setshow_env (char *s) {
char
*
p
;
int
status
;
if
(
strlen
(
param1
)
==
0
)
{
if
(
param1
[
0
]
==
0x00
&&
quals
[
0
]
==
0x0
0
)
{
env
=
GetEnvironmentStrings
();
WCMD_setshow_sortenv
(
env
,
NULL
);
return
;
}
else
{
/* See if /P supplied, and if so echo the prompt, and read in a reply */
if
(
CompareString
(
LOCALE_USER_DEFAULT
,
NORM_IGNORECASE
|
SORT_STRINGSORT
,
s
,
2
,
"/P"
,
-
1
)
==
2
)
{
char
string
[
MAXSTRING
];
DWORD
count
;
s
+=
2
;
while
(
*
s
&&
*
s
==
' '
)
s
++
;
/* If no parameter, or no '=' sign, return an error */
if
(
!
(
*
s
)
||
((
p
=
strchr
(
s
,
'='
))
==
NULL
))
{
WCMD_output
(
"Argument missing
\n
"
);
return
;
}
/* Output the prompt */
*
p
++
=
'\0'
;
if
(
strlen
(
p
)
!=
0
)
WCMD_output
(
p
);
/* Read the reply */
ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
string
,
sizeof
(
string
),
&
count
,
NULL
);
if
(
count
>
1
)
{
string
[
count
-
1
]
=
'\0'
;
/* ReadFile output is not null-terminated! */
if
(
string
[
count
-
2
]
==
'\r'
)
string
[
count
-
2
]
=
'\0'
;
/* Under Windoze we get CRLF! */
WINE_TRACE
(
"set /p: Setting var '%s' to '%s'
\n
"
,
s
,
string
);
status
=
SetEnvironmentVariable
(
s
,
string
);
}
}
else
{
p
=
strchr
(
s
,
'='
);
if
(
p
==
NULL
)
{
env
=
GetEnvironmentStrings
();
...
...
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