Commit 73995c71 authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

cmd: Add support for GEQ comparison operator in if statements.

parent 80f8d49b
......@@ -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;
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment