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
8a7687d8
Commit
8a7687d8
authored
Jan 21, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Jan 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
programs: Add support to arguments with dash in taskkill.
parent
294adeec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
taskkill.c
programs/taskkill/taskkill.c
+24
-13
No files found.
programs/taskkill/taskkill.c
View file @
8a7687d8
...
@@ -447,36 +447,46 @@ static BOOL add_to_task_list(WCHAR *name)
...
@@ -447,36 +447,46 @@ static BOOL add_to_task_list(WCHAR *name)
* options are detected as parameters when placed after options that accept one. */
* options are detected as parameters when placed after options that accept one. */
static
BOOL
process_arguments
(
int
argc
,
WCHAR
*
argv
[])
static
BOOL
process_arguments
(
int
argc
,
WCHAR
*
argv
[])
{
{
static
const
WCHAR
slashForceTerminate
[]
=
{
'/'
,
'f'
,
0
};
static
const
WCHAR
opForceTerminate
[]
=
{
'f'
,
0
};
static
const
WCHAR
slashImage
[]
=
{
'/'
,
'i'
,
'm'
,
0
};
static
const
WCHAR
opImage
[]
=
{
'i'
,
'm'
,
0
};
static
const
WCHAR
slashPID
[]
=
{
'/'
,
'p'
,
'i'
,
'd'
,
0
};
static
const
WCHAR
opPID
[]
=
{
'p'
,
'i'
,
'd'
,
0
};
static
const
WCHAR
slashHelp
[]
=
{
'/'
,
'?'
,
0
};
static
const
WCHAR
opHelp
[]
=
{
'?'
,
0
};
static
const
WCHAR
slashTerminateChildren
[]
=
{
'/'
,
't'
,
0
};
static
const
WCHAR
opTerminateChildren
[]
=
{
't'
,
0
};
if
(
argc
>
1
)
if
(
argc
>
1
)
{
{
int
i
;
int
i
;
WCHAR
*
argdata
;
BOOL
has_im
=
FALSE
,
has_pid
=
FALSE
;
BOOL
has_im
=
FALSE
,
has_pid
=
FALSE
;
/* Only the lone help option is recognized. */
/* Only the lone help option is recognized. */
if
(
argc
==
2
&&
!
strcmpW
(
slashHelp
,
argv
[
1
])
)
if
(
argc
==
2
)
{
{
taskkill_message
(
STRING_USAGE
);
argdata
=
argv
[
1
];
exit
(
0
);
if
((
*
argdata
==
'/'
||
*
argdata
==
'-'
)
&&
!
strcmpW
(
opHelp
,
argdata
+
1
))
{
taskkill_message
(
STRING_USAGE
);
exit
(
0
);
}
}
}
for
(
i
=
1
;
i
<
argc
;
i
++
)
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
{
int
got_im
=
0
,
got_pid
=
0
;
int
got_im
=
0
,
got_pid
=
0
;
if
(
!
strcmpiW
(
slashTerminateChildren
,
argv
[
i
]))
argdata
=
argv
[
i
];
WINE_FIXME
(
"/T not supported
\n
"
);
if
(
*
argdata
!=
'/'
&&
*
argdata
!=
'-'
)
if
(
!
strcmpiW
(
slashForceTerminate
,
argv
[
i
]))
goto
invalid
;
argdata
++
;
if
(
!
strcmpiW
(
opTerminateChildren
,
argdata
))
WINE_FIXME
(
"argument T not supported
\n
"
);
if
(
!
strcmpiW
(
opForceTerminate
,
argdata
))
force_termination
=
TRUE
;
force_termination
=
TRUE
;
/* Options /IM and /PID appear to behave identically, except for
/* Options /IM and /PID appear to behave identically, except for
* the fact that they cannot be specified at the same time. */
* the fact that they cannot be specified at the same time. */
else
if
((
got_im
=
!
strcmpiW
(
slashImage
,
argv
[
i
]
))
||
else
if
((
got_im
=
!
strcmpiW
(
opImage
,
argdata
))
||
(
got_pid
=
!
strcmpiW
(
slashPID
,
argv
[
i
]
)))
(
got_pid
=
!
strcmpiW
(
opPID
,
argdata
)))
{
{
if
(
!
argv
[
i
+
1
])
if
(
!
argv
[
i
+
1
])
{
{
...
@@ -501,6 +511,7 @@ static BOOL process_arguments(int argc, WCHAR *argv[])
...
@@ -501,6 +511,7 @@ static BOOL process_arguments(int argc, WCHAR *argv[])
}
}
else
else
{
{
invalid:
taskkill_message
(
STRING_INVALID_OPTION
);
taskkill_message
(
STRING_INVALID_OPTION
);
taskkill_message
(
STRING_USAGE
);
taskkill_message
(
STRING_USAGE
);
return
FALSE
;
return
FALSE
;
...
...
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