Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olivier F. R. Dierick
wine
Commits
80f8d49b
Commit
80f8d49b
authored
12 years ago
by
Frédéric Delanoy
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
cmd: Add support for NEQ comparison operator in if statements.
parent
14cd4151
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
programs/cmd/builtins.c
+9
-0
9 additions, 0 deletions
programs/cmd/builtins.c
programs/cmd/tests/test_builtins.cmd.exp
+32
-32
32 additions, 32 deletions
programs/cmd/tests/test_builtins.cmd.exp
with
41 additions
and
32 deletions
programs/cmd/builtins.c
+
9
−
0
View file @
80f8d49b
...
...
@@ -2358,6 +2358,7 @@ static int evaluate_if_comparison(const WCHAR *leftOperand, const WCHAR *operato
static
const
WCHAR
lssW
[]
=
{
'l'
,
's'
,
's'
,
'\0'
};
static
const
WCHAR
leqW
[]
=
{
'l'
,
'e'
,
'q'
,
'\0'
};
static
const
WCHAR
equW
[]
=
{
'e'
,
'q'
,
'u'
,
'\0'
};
static
const
WCHAR
neqW
[]
=
{
'n'
,
'e'
,
'q'
,
'\0'
};
/* == is a special case, as it always compares strings */
if
(
!
lstrcmpiW
(
operator
,
eqeqW
))
...
...
@@ -2394,6 +2395,14 @@ static int evaluate_if_comparison(const WCHAR *leftOperand, const WCHAR *operato
:
lstrcmpW
(
leftOperand
,
rightOperand
)
==
0
;
}
if
(
!
lstrcmpiW
(
operator
,
neqW
))
{
if
(
int_operands
)
return
leftOperand_int
!=
rightOperand_int
;
else
return
caseInsensitive
?
lstrcmpiW
(
leftOperand
,
rightOperand
)
!=
0
:
lstrcmpW
(
leftOperand
,
rightOperand
)
!=
0
;
}
return
-
1
;
}
...
...
This diff is collapsed.
Click to expand it.
programs/cmd/tests/test_builtins.cmd.exp
+
32
−
32
View file @
80f8d49b
...
...
@@ -487,26 +487,26 @@ AB EQU AB
BA EQU BA
AA EQU AA
A EQU a insensitive
@todo_wine@
B NEQ A
@todo_wine@
AB NEQ A
@todo_wine@
BA NEQ A
@todo_wine@
AA NEQ A
@todo_wine@
A NEQ B
@todo_wine@
AB NEQ B
@todo_wine@
BA NEQ B
@todo_wine@
AA NEQ B
@todo_wine@
A NEQ AB
@todo_wine@
B NEQ AB
@todo_wine@
BA NEQ AB
@todo_wine@
AA NEQ AB
@todo_wine@
A NEQ BA
@todo_wine@
B NEQ BA
@todo_wine@
AB NEQ BA
@todo_wine@
AA NEQ BA
@todo_wine@
A NEQ AA
@todo_wine@
B NEQ AA
@todo_wine@
AB NEQ AA
@todo_wine@
BA NEQ AA
B NEQ A
AB NEQ A
BA NEQ A
AA NEQ A
A NEQ B
AB NEQ B
BA NEQ B
AA NEQ B
A NEQ AB
B NEQ AB
BA NEQ AB
AA NEQ AB
A NEQ BA
B NEQ BA
AB NEQ BA
AA NEQ BA
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
...
...
@@ -564,18 +564,18 @@ octal ok
hexa ok
string/hexa compare ok
string/hexa compare ok
@todo_wine@
1 NEQ 0
@todo_wine@
10 NEQ 0
@todo_wine@
9 NEQ 0
@todo_wine@
0 NEQ 1
@todo_wine@
10 NEQ 1
@todo_wine@
9 NEQ 1
@todo_wine@
0 NEQ 10
@todo_wine@
1 NEQ 10
@todo_wine@
9 NEQ 10
@todo_wine@
0 NEQ 9
@todo_wine@
1 NEQ 9
@todo_wine@
10 NEQ 9
1 NEQ 0
10 NEQ 0
9 NEQ 0
0 NEQ 1
10 NEQ 1
9 NEQ 1
0 NEQ 10
1 NEQ 10
9 NEQ 10
0 NEQ 9
1 NEQ 9
10 NEQ 9
@todo_wine@0 GEQ 0
@todo_wine@1 GEQ 0
@todo_wine@10 GEQ 0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment