cmd: Add support for GTR comparison operator in if statements.
This commit is contained in:
parent
73995c71e0
commit
90c6f57fa9
|
@ -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 equW[] = {'e','q','u','\0'};
|
||||||
static const WCHAR neqW[] = {'n','e','q','\0'};
|
static const WCHAR neqW[] = {'n','e','q','\0'};
|
||||||
static const WCHAR geqW[] = {'g','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 */
|
/* == is a special case, as it always compares strings */
|
||||||
if (!lstrcmpiW(operator, eqeqW))
|
if (!lstrcmpiW(operator, eqeqW))
|
||||||
|
@ -2412,6 +2413,14 @@ static int evaluate_if_comparison(const WCHAR *leftOperand, const WCHAR *operato
|
||||||
: lstrcmpW (leftOperand, rightOperand) >= 0;
|
: 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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -522,16 +522,16 @@ B GEQ AA
|
||||||
AB GEQ AA
|
AB GEQ AA
|
||||||
BA GEQ AA
|
BA GEQ AA
|
||||||
AA GEQ AA
|
AA GEQ AA
|
||||||
@todo_wine@B GTR A
|
B GTR A
|
||||||
@todo_wine@AB GTR A
|
AB GTR A
|
||||||
@todo_wine@BA GTR A
|
BA GTR A
|
||||||
@todo_wine@AA GTR A
|
AA GTR A
|
||||||
@todo_wine@BA GTR B
|
BA GTR B
|
||||||
@todo_wine@B GTR AB
|
B GTR AB
|
||||||
@todo_wine@BA GTR AB
|
BA GTR AB
|
||||||
@todo_wine@B GTR AA
|
B GTR AA
|
||||||
@todo_wine@AB GTR AA
|
AB GTR AA
|
||||||
@todo_wine@BA GTR AA
|
BA GTR AA
|
||||||
------ for numbers
|
------ for numbers
|
||||||
negative numbers handled
|
negative numbers handled
|
||||||
negative numbers handled
|
negative numbers handled
|
||||||
|
@ -586,12 +586,12 @@ string/hexa compare ok
|
||||||
10 GEQ 10
|
10 GEQ 10
|
||||||
10 GEQ 9
|
10 GEQ 9
|
||||||
9 GEQ 9
|
9 GEQ 9
|
||||||
@todo_wine@1 GTR 0
|
1 GTR 0
|
||||||
@todo_wine@10 GTR 0
|
10 GTR 0
|
||||||
@todo_wine@9 GTR 0
|
9 GTR 0
|
||||||
@todo_wine@10 GTR 1
|
10 GTR 1
|
||||||
@todo_wine@9 GTR 1
|
9 GTR 1
|
||||||
@todo_wine@10 GTR 9
|
10 GTR 9
|
||||||
------ for numbers and stringified numbers
|
------ for numbers and stringified numbers
|
||||||
strings and integers not equal
|
strings and integers not equal
|
||||||
strings and integers not equal
|
strings and integers not equal
|
||||||
|
|
Loading…
Reference in New Issue