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
73995c71
Commit
73995c71
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 GEQ comparison operator in if statements.
parent
80f8d49b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
38 deletions
+47
-38
builtins.c
programs/cmd/builtins.c
+9
-0
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+38
-38
No files found.
programs/cmd/builtins.c
View file @
73995c71
...
...
@@ -2359,6 +2359,7 @@ static int evaluate_if_comparison(const WCHAR *leftOperand, const WCHAR *operato
static
const
WCHAR
leqW
[]
=
{
'l'
,
'e'
,
'q'
,
'\0'
};
static
const
WCHAR
equW
[]
=
{
'e'
,
'q'
,
'u'
,
'\0'
};
static
const
WCHAR
neqW
[]
=
{
'n'
,
'e'
,
'q'
,
'\0'
};
static
const
WCHAR
geqW
[]
=
{
'g'
,
'e'
,
'q'
,
'\0'
};
/* == is a special case, as it always compares strings */
if
(
!
lstrcmpiW
(
operator
,
eqeqW
))
...
...
@@ -2403,6 +2404,14 @@ static int evaluate_if_comparison(const WCHAR *leftOperand, const WCHAR *operato
:
lstrcmpW
(
leftOperand
,
rightOperand
)
!=
0
;
}
if
(
!
lstrcmpiW
(
operator
,
geqW
))
{
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 @
73995c71
...
...
@@ -507,21 +507,21 @@ A NEQ AA
B NEQ AA
AB NEQ AA
BA NEQ AA
@todo_wine@
A GEQ A
@todo_wine@
B GEQ A
@todo_wine@
AB GEQ A
@todo_wine@
BA GEQ A
@todo_wine@
AA GEQ A
@todo_wine@
B GEQ B
@todo_wine@
BA GEQ B
@todo_wine@
B GEQ AB
@todo_wine@
AB GEQ AB
@todo_wine@
BA GEQ AB
@todo_wine@
BA GEQ BA
@todo_wine@
B GEQ AA
@todo_wine@
AB GEQ AA
@todo_wine@
BA GEQ AA
@todo_wine@
AA GEQ AA
A GEQ A
B GEQ A
AB GEQ A
BA GEQ A
AA GEQ A
B GEQ B
BA GEQ B
B GEQ AB
AB GEQ AB
BA GEQ AB
BA GEQ BA
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
...
...
@@ -576,16 +576,16 @@ string/hexa compare ok
0 NEQ 9
1 NEQ 9
10 NEQ 9
@todo_wine@
0 GEQ 0
@todo_wine@
1 GEQ 0
@todo_wine@
10 GEQ 0
@todo_wine@
9 GEQ 0
@todo_wine@
1 GEQ 1
@todo_wine@
10 GEQ 1
@todo_wine@
9 GEQ 1
@todo_wine@
10 GEQ 10
@todo_wine@
10 GEQ 9
@todo_wine@
9 GEQ 9
0 GEQ 0
1 GEQ 0
10 GEQ 0
9 GEQ 0
1 GEQ 1
10 GEQ 1
9 GEQ 1
10 GEQ 10
10 GEQ 9
9 GEQ 9
@todo_wine@1 GTR 0
@todo_wine@10 GTR 0
@todo_wine@9 GTR 0
...
...
@@ -596,19 +596,19 @@ string/hexa compare ok
strings and integers not equal
strings and integers not equal
foo
@todo_wine@
"10" GEQ "1"
@todo_wine@
'1' GEQ 1@or_broken@NT4
@todo_wine@
1 GEQ "1"
@todo_wine@
"1" GEQ "1"
@todo_wine@
'1' GEQ "1"
@todo_wine@
"10" GEQ "1"
@todo_wine@
non NT4@or_broken@1 GEQ '1'
@todo_wine@
'1' GEQ '1'
@todo_wine@
foo
@todo_wine@
1 GEQ "10"
@todo_wine@
foo
@todo_wine@
'1' GEQ "10"
@todo_wine@
"10" GEQ "10"
"10" GEQ "1"
'1' GEQ 1@or_broken@NT4
1 GEQ "1"
"1" GEQ "1"
'1' GEQ "1"
"10" GEQ "1"
non NT4@or_broken@1 GEQ '1'
'1' GEQ '1'
foo
1 GEQ "10"
foo
'1' GEQ "10"
"10" GEQ "10"
------------ Testing for ------------
--- plain FOR
A
...
...
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