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
14cd4151
Commit
14cd4151
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: Add support for EQU comparison operator in if statements.
parent
78af04f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
+23
-14
builtins.c
programs/cmd/builtins.c
+9
-0
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+14
-14
No files found.
programs/cmd/builtins.c
View file @
14cd4151
...
...
@@ -2357,6 +2357,7 @@ static int evaluate_if_comparison(const WCHAR *leftOperand, const WCHAR *operato
BOOL
int_operands
;
static
const
WCHAR
lssW
[]
=
{
'l'
,
's'
,
's'
,
'\0'
};
static
const
WCHAR
leqW
[]
=
{
'l'
,
'e'
,
'q'
,
'\0'
};
static
const
WCHAR
equW
[]
=
{
'e'
,
'q'
,
'u'
,
'\0'
};
/* == is a special case, as it always compares strings */
if
(
!
lstrcmpiW
(
operator
,
eqeqW
))
...
...
@@ -2385,6 +2386,14 @@ static int evaluate_if_comparison(const WCHAR *leftOperand, const WCHAR *operato
:
lstrcmpW
(
leftOperand
,
rightOperand
)
<=
0
;
}
if
(
!
lstrcmpiW
(
operator
,
equW
))
{
if
(
int_operands
)
return
leftOperand_int
==
rightOperand_int
;
else
return
caseInsensitive
?
lstrcmpiW
(
leftOperand
,
rightOperand
)
==
0
:
lstrcmpW
(
leftOperand
,
rightOperand
)
==
0
;
}
return
-
1
;
}
...
...
programs/cmd/tests/test_builtins.cmd.exp
View file @
14cd4151
...
...
@@ -481,12 +481,12 @@ a LEQ B@or_broken@NT4
a LEQ B insensitive
A LEQ b
A LEQ b insensitive
@todo_wine@
A EQU A
@todo_wine@
B EQU B
@todo_wine@
AB EQU AB
@todo_wine@
BA EQU BA
@todo_wine@
AA EQU AA
@todo_wine@
A EQU a insensitive
A EQU A
B EQU B
AB EQU AB
BA EQU BA
AA EQU AA
A EQU a insensitive
@todo_wine@B NEQ A
@todo_wine@AB NEQ A
@todo_wine@BA NEQ A
...
...
@@ -556,14 +556,14 @@ also in negative form
0 LEQ 9
1 LEQ 9
9 LEQ 9
@todo_wine@
0 EQU 0
@todo_wine@
1 EQU 1
@todo_wine@
10 EQU 10
@todo_wine@
9 EQU 9
@todo_wine@
octal ok
@todo_wine@
hexa ok
@todo_wine@
string/hexa compare ok
@todo_wine@
string/hexa compare ok
0 EQU 0
1 EQU 1
10 EQU 10
9 EQU 9
octal ok
hexa ok
string/hexa compare ok
string/hexa compare ok
@todo_wine@1 NEQ 0
@todo_wine@10 NEQ 0
@todo_wine@9 NEQ 0
...
...
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