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
78af04f4
Commit
78af04f4
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 LEQ comparison operator in if statements.
parent
154710a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
31 deletions
+40
-31
builtins.c
programs/cmd/builtins.c
+9
-0
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+31
-31
No files found.
programs/cmd/builtins.c
View file @
78af04f4
...
...
@@ -2356,6 +2356,7 @@ static int evaluate_if_comparison(const WCHAR *leftOperand, const WCHAR *operato
long
int
leftOperand_int
,
rightOperand_int
;
BOOL
int_operands
;
static
const
WCHAR
lssW
[]
=
{
'l'
,
's'
,
's'
,
'\0'
};
static
const
WCHAR
leqW
[]
=
{
'l'
,
'e'
,
'q'
,
'\0'
};
/* == is a special case, as it always compares strings */
if
(
!
lstrcmpiW
(
operator
,
eqeqW
))
...
...
@@ -2376,6 +2377,14 @@ static int evaluate_if_comparison(const WCHAR *leftOperand, const WCHAR *operato
:
lstrcmpW
(
leftOperand
,
rightOperand
)
<
0
;
}
if
(
!
lstrcmpiW
(
operator
,
leqW
))
{
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 @
78af04f4
...
...
@@ -460,27 +460,27 @@ a LSS B@or_broken@NT4
a LSS B insensitive
A LSS b
A LSS b insensitive
@todo_wine@
A LEQ A
@todo_wine@
A LEQ B
@todo_wine@
B LEQ B
@todo_wine@
AB LEQ B
@todo_wine@
AA LEQ B
@todo_wine@
A LEQ AB
@todo_wine@
AB LEQ AB
@todo_wine@
AA LEQ AB
@todo_wine@
A LEQ BA
@todo_wine@
B LEQ BA
@todo_wine@
AB LEQ BA
@todo_wine@
BA LEQ BA
@todo_wine@
AA LEQ BA
@todo_wine@
A LEQ AA
@todo_wine@
AA LEQ AA
@todo_wine@
b LEQ B@or_broken@NT4
@todo_wine@
b LEQ B insensitive
@todo_wine@
a LEQ B@or_broken@NT4
@todo_wine@
a LEQ B insensitive
@todo_wine@
A LEQ b
@todo_wine@
A LEQ b insensitive
A LEQ A
A LEQ B
B LEQ B
AB LEQ B
AA LEQ B
A LEQ AB
AB LEQ AB
AA LEQ AB
A LEQ BA
B LEQ BA
AB LEQ BA
BA LEQ BA
AA LEQ BA
A LEQ AA
AA LEQ AA
b LEQ B@or_broken@NT4
b LEQ B insensitive
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
...
...
@@ -546,16 +546,16 @@ also in negative form
9 LSS 10
0 LSS 9
1 LSS 9
@todo_wine@
0 LEQ 0
@todo_wine@
0 LEQ 1
@todo_wine@
1 LEQ 1
@todo_wine@
0 LEQ 10
@todo_wine@
1 LEQ 10
@todo_wine@
10 LEQ 10
@todo_wine@
9 LEQ 10
@todo_wine@
0 LEQ 9
@todo_wine@
1 LEQ 9
@todo_wine@
9 LEQ 9
0 LEQ 0
0 LEQ 1
1 LEQ 1
0 LEQ 10
1 LEQ 10
10 LEQ 10
9 LEQ 10
0 LEQ 9
1 LEQ 9
9 LEQ 9
@todo_wine@0 EQU 0
@todo_wine@1 EQU 1
@todo_wine@10 EQU 10
...
...
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