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
90c6f57f
Commit
90c6f57f
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 GTR comparison operator in if statements.
parent
73995c71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
16 deletions
+25
-16
builtins.c
programs/cmd/builtins.c
+9
-0
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+16
-16
No files found.
programs/cmd/builtins.c
View file @
90c6f57f
...
...
@@ -2360,6 +2360,7 @@ static int evaluate_if_comparison(const WCHAR *leftOperand, const WCHAR *operato
static
const
WCHAR
equW
[]
=
{
'e'
,
'q'
,
'u'
,
'\0'
};
static
const
WCHAR
neqW
[]
=
{
'n'
,
'e'
,
'q'
,
'\0'
};
static
const
WCHAR
geqW
[]
=
{
'g'
,
'e'
,
'q'
,
'\0'
};
static
const
WCHAR
gtrW
[]
=
{
'g'
,
't'
,
'r'
,
'\0'
};
/* == is a special case, as it always compares strings */
if
(
!
lstrcmpiW
(
operator
,
eqeqW
))
...
...
@@ -2412,6 +2413,14 @@ static int evaluate_if_comparison(const WCHAR *leftOperand, const WCHAR *operato
:
lstrcmpW
(
leftOperand
,
rightOperand
)
>=
0
;
}
if
(
!
lstrcmpiW
(
operator
,
gtrW
))
{
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 @
90c6f57f
...
...
@@ -522,16 +522,16 @@ B GEQ AA
AB GEQ AA
BA GEQ AA
AA GEQ AA
@todo_wine@
B GTR A
@todo_wine@
AB GTR A
@todo_wine@
BA GTR A
@todo_wine@
AA GTR A
@todo_wine@
BA GTR B
@todo_wine@
B GTR AB
@todo_wine@
BA GTR AB
@todo_wine@
B GTR AA
@todo_wine@
AB GTR AA
@todo_wine@
BA GTR AA
B GTR A
AB GTR A
BA GTR A
AA GTR A
BA GTR B
B GTR AB
BA GTR AB
B GTR AA
AB GTR AA
BA GTR AA
------ for numbers
negative numbers handled
negative numbers handled
...
...
@@ -586,12 +586,12 @@ string/hexa compare ok
10 GEQ 10
10 GEQ 9
9 GEQ 9
@todo_wine@
1 GTR 0
@todo_wine@
10 GTR 0
@todo_wine@
9 GTR 0
@todo_wine@
10 GTR 1
@todo_wine@
9 GTR 1
@todo_wine@
10 GTR 9
1 GTR 0
10 GTR 0
9 GTR 0
10 GTR 1
9 GTR 1
10 GTR 9
------ for numbers and stringified numbers
strings and integers not equal
strings and integers not equal
...
...
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