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
dd139544
Commit
dd139544
authored
Oct 25, 2012
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Oct 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Move common error reporting code in WCMD_if.
parent
cee1652e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
builtins.c
programs/cmd/builtins.c
+8
-11
No files found.
programs/cmd/builtins.c
View file @
dd139544
...
...
@@ -2346,9 +2346,8 @@ void WCMD_popd (void) {
*
* FIXME: Much more syntax checking needed!
*/
void
WCMD_if
(
WCHAR
*
p
,
CMD_LIST
**
cmdList
)
{
void
WCMD_if
(
WCHAR
*
p
,
CMD_LIST
**
cmdList
)
{
int
negate
;
/* Negate condition */
int
test
;
/* Condition evaluation result */
WCHAR
condition
[
MAX_PATH
],
*
command
,
*
s
;
...
...
@@ -2368,10 +2367,7 @@ void WCMD_if (WCHAR *p, CMD_LIST **cmdList) {
WCHAR
*
param
=
WCMD_parameter
(
p
,
1
+
negate
,
NULL
,
FALSE
,
FALSE
);
WCHAR
*
endptr
;
long
int
param_int
=
strtolW
(
param
,
&
endptr
,
10
);
if
(
*
endptr
)
{
WCMD_output_stderr
(
WCMD_LoadMessage
(
WCMD_SYNTAXERR
));
return
;
}
if
(
*
endptr
)
goto
syntax_err
;
test
=
((
long
int
)
errorlevel
>=
param_int
);
WCMD_parameter
(
p
,
2
+
negate
,
&
command
,
FALSE
,
FALSE
);
}
...
...
@@ -2401,14 +2397,15 @@ void WCMD_if (WCHAR *p, CMD_LIST **cmdList) {
rightPart
,
rightPartLen
)
==
CSTR_EQUAL
);
WCMD_parameter
(
s
,
1
,
&
command
,
FALSE
,
FALSE
);
}
else
{
WCMD_output_stderr
(
WCMD_LoadMessage
(
WCMD_SYNTAXERR
));
return
;
}
else
goto
syntax_err
;
/* Process rest of IF statement which is on the same line
Note: This may process all or some of the cmdList (eg a GOTO) */
WCMD_part_execute
(
cmdList
,
command
,
NULL
,
NULL
,
TRUE
,
(
test
!=
negate
));
return
;
syntax_err:
WCMD_output_stderr
(
WCMD_LoadMessage
(
WCMD_SYNTAXERR
));
}
/****************************************************************************
...
...
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