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
191056ad
Commit
191056ad
authored
Sep 06, 2011
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Sep 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Clarify WCMD_if function.
parent
7b9af226
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
21 deletions
+10
-21
builtins.c
programs/cmd/builtins.c
+10
-21
No files found.
programs/cmd/builtins.c
View file @
191056ad
...
@@ -1497,7 +1497,8 @@ void WCMD_popd (void) {
...
@@ -1497,7 +1497,8 @@ void WCMD_popd (void) {
void
WCMD_if
(
WCHAR
*
p
,
CMD_LIST
**
cmdList
)
{
void
WCMD_if
(
WCHAR
*
p
,
CMD_LIST
**
cmdList
)
{
int
negate
=
0
,
test
=
0
;
int
negate
;
/* Negate condition */
int
test
;
/* Condition evaluation result */
WCHAR
condition
[
MAX_PATH
],
*
command
,
*
s
;
WCHAR
condition
[
MAX_PATH
],
*
command
,
*
s
;
static
const
WCHAR
notW
[]
=
{
'n'
,
'o'
,
't'
,
'\0'
};
static
const
WCHAR
notW
[]
=
{
'n'
,
'o'
,
't'
,
'\0'
};
static
const
WCHAR
errlvlW
[]
=
{
'e'
,
'r'
,
'r'
,
'o'
,
'r'
,
'l'
,
'e'
,
'v'
,
'e'
,
'l'
,
'\0'
};
static
const
WCHAR
errlvlW
[]
=
{
'e'
,
'r'
,
'r'
,
'o'
,
'r'
,
'l'
,
'e'
,
'v'
,
'e'
,
'l'
,
'\0'
};
...
@@ -1505,40 +1506,28 @@ void WCMD_if (WCHAR *p, CMD_LIST **cmdList) {
...
@@ -1505,40 +1506,28 @@ void WCMD_if (WCHAR *p, CMD_LIST **cmdList) {
static
const
WCHAR
defdW
[]
=
{
'd'
,
'e'
,
'f'
,
'i'
,
'n'
,
'e'
,
'd'
,
'\0'
};
static
const
WCHAR
defdW
[]
=
{
'd'
,
'e'
,
'f'
,
'i'
,
'n'
,
'e'
,
'd'
,
'\0'
};
static
const
WCHAR
eqeqW
[]
=
{
'='
,
'='
,
'\0'
};
static
const
WCHAR
eqeqW
[]
=
{
'='
,
'='
,
'\0'
};
static
const
WCHAR
parmI
[]
=
{
'/'
,
'I'
,
'\0'
};
static
const
WCHAR
parmI
[]
=
{
'/'
,
'I'
,
'\0'
};
int
caseInsensitive
=
(
strstrW
(
quals
,
parmI
)
!=
NULL
);
if
(
!
lstrcmpiW
(
param1
,
notW
))
{
negate
=
!
lstrcmpiW
(
param1
,
notW
);
negate
=
1
;
strcpyW
(
condition
,
(
negate
?
param2
:
param1
));
strcpyW
(
condition
,
param2
);
}
else
{
strcpyW
(
condition
,
param1
);
}
WINE_TRACE
(
"Condition: %s
\n
"
,
wine_dbgstr_w
(
condition
));
WINE_TRACE
(
"Condition: %s
\n
"
,
wine_dbgstr_w
(
condition
));
if
(
!
lstrcmpiW
(
condition
,
errlvlW
))
{
if
(
!
lstrcmpiW
(
condition
,
errlvlW
))
{
if
(
errorlevel
>=
atoiW
(
WCMD_parameter
(
p
,
1
+
negate
,
NULL
)))
test
=
1
;
test
=
(
errorlevel
>=
atoiW
(
WCMD_parameter
(
p
,
1
+
negate
,
NULL
)))
;
WCMD_parameter
(
p
,
2
+
negate
,
&
command
);
WCMD_parameter
(
p
,
2
+
negate
,
&
command
);
}
}
else
if
(
!
lstrcmpiW
(
condition
,
existW
))
{
else
if
(
!
lstrcmpiW
(
condition
,
existW
))
{
if
(
GetFileAttributesW
(
WCMD_parameter
(
p
,
1
+
negate
,
NULL
))
!=
INVALID_FILE_ATTRIBUTES
)
{
test
=
(
GetFileAttributesW
(
WCMD_parameter
(
p
,
1
+
negate
,
NULL
))
!=
INVALID_FILE_ATTRIBUTES
);
test
=
1
;
}
WCMD_parameter
(
p
,
2
+
negate
,
&
command
);
WCMD_parameter
(
p
,
2
+
negate
,
&
command
);
}
}
else
if
(
!
lstrcmpiW
(
condition
,
defdW
))
{
else
if
(
!
lstrcmpiW
(
condition
,
defdW
))
{
if
(
GetEnvironmentVariableW
(
WCMD_parameter
(
p
,
1
+
negate
,
NULL
),
NULL
,
0
)
>
0
)
{
test
=
(
GetEnvironmentVariableW
(
WCMD_parameter
(
p
,
1
+
negate
,
NULL
),
NULL
,
0
)
>
0
);
test
=
1
;
}
WCMD_parameter
(
p
,
2
+
negate
,
&
command
);
WCMD_parameter
(
p
,
2
+
negate
,
&
command
);
}
}
else
if
((
s
=
strstrW
(
p
,
eqeqW
)))
{
else
if
((
s
=
strstrW
(
p
,
eqeqW
)))
{
s
+=
2
;
s
+=
2
;
if
(
strstrW
(
quals
,
parmI
)
==
NULL
)
{
test
=
caseInsensitive
?
(
!
lstrcmpiW
(
condition
,
WCMD_parameter
(
s
,
0
,
NULL
)))
if
(
!
lstrcmpW
(
condition
,
WCMD_parameter
(
s
,
0
,
NULL
)))
test
=
1
;
:
(
!
lstrcmpW
(
condition
,
WCMD_parameter
(
s
,
0
,
NULL
)));
}
else
{
if
(
!
lstrcmpiW
(
condition
,
WCMD_parameter
(
s
,
0
,
NULL
)))
test
=
1
;
}
WCMD_parameter
(
s
,
1
,
&
command
);
WCMD_parameter
(
s
,
1
,
&
command
);
}
}
else
{
else
{
...
...
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