Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- programs/schtasks/schtasks.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-)
diff --git a/programs/schtasks/schtasks.c b/programs/schtasks/schtasks.c index 2ffc241153d..ae28f30ad48 100644 --- a/programs/schtasks/schtasks.c +++ b/programs/schtasks/schtasks.c @@ -25,16 +25,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(schtasks);
-static const WCHAR change_optW[] = {'/','c','h','a','n','g','e',0}; -static const WCHAR create_optW[] = {'/','c','r','e','a','t','e',0}; -static const WCHAR delete_optW[] = {'/','d','e','l','e','t','e',0}; -static const WCHAR enable_optW[] = {'/','e','n','a','b','l','e',0}; -static const WCHAR f_optW[] = {'/','f',0}; -static const WCHAR ru_optW[] = {'/','r','u',0}; -static const WCHAR tn_optW[] = {'/','t','n',0}; -static const WCHAR tr_optW[] = {'/','t','r',0}; -static const WCHAR xml_optW[] = {'/','x','m','l',0}; - static ITaskFolder *get_tasks_root_folder(void) { ITaskService *service; @@ -140,7 +130,7 @@ static int change_command(int argc, WCHAR *argv[]) HRESULT hres;
while (argc) { - if(!wcsicmp(argv[0], tn_optW)) { + if (!wcsicmp(argv[0], L"/tn")) { if (argc < 2) { FIXME("Missing /tn value\n"); return 1; @@ -154,12 +144,12 @@ static int change_command(int argc, WCHAR *argv[]) task_name = argv[1]; argc -= 2; argv += 2; - }else if (!wcsicmp(argv[0], enable_optW)) { + } else if (!wcsicmp(argv[0], L"/enable")) { enable = TRUE; have_option = TRUE; argc--; argv++; - }else if (!wcsicmp(argv[0], tr_optW)) { + } else if (!wcsicmp(argv[0], L"/tr")) { if (argc < 2) { FIXME("Missing /tr value\n"); return 1; @@ -213,7 +203,7 @@ static int create_command(int argc, WCHAR *argv[]) HRESULT hres;
while (argc) { - if (!wcsicmp(argv[0], xml_optW)) { + if (!wcsicmp(argv[0], L"/xml")) { if (argc < 2) { FIXME("Missing /xml value\n"); return 1; @@ -227,7 +217,7 @@ static int create_command(int argc, WCHAR *argv[]) xml_file = argv[1]; argc -= 2; argv += 2; - }else if(!wcsicmp(argv[0], tn_optW)) { + } else if (!wcsicmp(argv[0], L"/tn")) { if (argc < 2) { FIXME("Missing /tn value\n"); return 1; @@ -241,11 +231,11 @@ static int create_command(int argc, WCHAR *argv[]) task_name = argv[1]; argc -= 2; argv += 2; - }else if(!wcsicmp(argv[0], f_optW)) { + } else if (!wcsicmp(argv[0], L"/f")) { flags = TASK_CREATE_OR_UPDATE; argc--; argv++; - }else if (!wcsicmp(argv[0], ru_optW)) { + } else if (!wcsicmp(argv[0], L"/ru")) { if (argc < 2) { FIXME("Missing /ru value\n"); return 1; @@ -302,11 +292,11 @@ static int delete_command(int argc, WCHAR *argv[]) HRESULT hres;
while (argc) { - if (!wcsicmp(argv[0], f_optW)) { + if (!wcsicmp(argv[0], L"/f")) { TRACE("force opt\n"); argc--; argv++; - }else if(!wcsicmp(argv[0], tn_optW)) { + } else if (!wcsicmp(argv[0], L"/tn")) { if (argc < 2) { FIXME("Missing /tn value\n"); return 1; @@ -357,11 +347,11 @@ int __cdecl wmain(int argc, WCHAR *argv[])
if (argc < 2) FIXME("Print current tasks state\n"); - else if (!wcsicmp(argv[1], change_optW)) + else if (!wcsicmp(argv[1], L"/change")) ret = change_command(argc - 2, argv + 2); - else if (!wcsicmp(argv[1], create_optW)) + else if (!wcsicmp(argv[1], L"/create")) ret = create_command(argc - 2, argv + 2); - else if (!wcsicmp(argv[1], delete_optW)) + else if (!wcsicmp(argv[1], L"/delete")) ret = delete_command(argc - 2, argv + 2); else FIXME("Unsupported command %s\n", debugstr_w(argv[1]));