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
712276c7
Commit
712276c7
authored
Sep 06, 2011
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Sep 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Fix IF operands parsing for '==' operator.
parent
3627c289
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
builtins.c
programs/cmd/builtins.c
+11
-2
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+3
-3
No files found.
programs/cmd/builtins.c
View file @
712276c7
...
@@ -1525,9 +1525,18 @@ void WCMD_if (WCHAR *p, CMD_LIST **cmdList) {
...
@@ -1525,9 +1525,18 @@ void WCMD_if (WCHAR *p, CMD_LIST **cmdList) {
WCMD_parameter
(
p
,
2
+
negate
,
&
command
,
NULL
);
WCMD_parameter
(
p
,
2
+
negate
,
&
command
,
NULL
);
}
}
else
if
((
s
=
strstrW
(
p
,
eqeqW
)))
{
else
if
((
s
=
strstrW
(
p
,
eqeqW
)))
{
/* We need to get potential surrounding double quotes, so param1/2 can't be used */
WCHAR
*
leftPart
,
*
leftPartEnd
,
*
rightPart
,
*
rightPartEnd
;
s
+=
2
;
s
+=
2
;
test
=
caseInsensitive
?
(
!
lstrcmpiW
(
condition
,
WCMD_parameter
(
s
,
0
,
NULL
,
NULL
)))
WCMD_parameter
(
p
,
0
+
negate
+
caseInsensitive
,
&
leftPart
,
&
leftPartEnd
);
:
(
!
lstrcmpW
(
condition
,
WCMD_parameter
(
s
,
0
,
NULL
,
NULL
)));
WCMD_parameter
(
p
,
1
+
negate
+
caseInsensitive
,
&
rightPart
,
&
rightPartEnd
);
test
=
caseInsensitive
?
(
CompareStringW
(
LOCALE_SYSTEM_DEFAULT
,
NORM_IGNORECASE
,
leftPart
,
leftPartEnd
-
leftPart
+
1
,
rightPart
,
rightPartEnd
-
rightPart
+
1
)
==
CSTR_EQUAL
)
:
(
CompareStringW
(
LOCALE_SYSTEM_DEFAULT
,
0
,
leftPart
,
leftPartEnd
-
leftPart
+
1
,
rightPart
,
rightPartEnd
-
rightPart
+
1
)
==
CSTR_EQUAL
);
WCMD_parameter
(
s
,
1
,
&
command
,
NULL
);
WCMD_parameter
(
s
,
1
,
&
command
,
NULL
);
}
}
else
{
else
{
...
...
programs/cmd/tests/test_builtins.cmd.exp
View file @
712276c7
...
@@ -382,15 +382,15 @@ NUL
...
@@ -382,15 +382,15 @@ NUL
if/else should work with blocks
if/else should work with blocks
if seems to work
if seems to work
else seems to work
else seems to work
@todo_wine@
if seems not to detect /c as parameter
if seems not to detect /c as parameter
Testing case sensitivity with and without /i option
Testing case sensitivity with and without /i option
if seems to default to case sensitivity
if seems to default to case sensitivity
if /i seems to work
if /i seems to work
if /I seems to work
if /I seems to work
Testing string comparisons
Testing string comparisons
equal
equal
@todo_wine@
non equal
non equal
@todo_wine@
non equal
non equal
equal
equal
Testing tabs handling
Testing tabs handling
doom
doom
...
...
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