Commit a3dbe3cc authored by Andrew Nguyen's avatar Andrew Nguyen Committed by Alexandre Julliard

reg: Fix behavior when specifying the help flag.

parent 24c6f5cc
......@@ -357,11 +357,12 @@ int wmain(int argc, WCHAR *argvW[])
static const WCHAR slashVW[] = {'/','v',0};
static const WCHAR slashVAW[] = {'/','v','a',0};
static const WCHAR slashVEW[] = {'/','v','e',0};
static const WCHAR slashHelpW[] = {'/','?',0};
if (argc < 2)
if (argc < 2 || !lstrcmpW(argvW[1], slashHelpW))
{
reg_message(STRING_USAGE);
return 1;
return 0;
}
if (!lstrcmpiW(argvW[1], addW))
......@@ -371,9 +372,14 @@ int wmain(int argc, WCHAR *argvW[])
if (argc < 3)
{
reg_message(STRING_ADD_USAGE);
reg_message(STRING_INVALID_CMDLINE);
return 1;
}
else if (argc == 3 && !lstrcmpW(argvW[2], slashHelpW))
{
reg_message(STRING_ADD_USAGE);
return 0;
}
key_name = argvW[2];
for (i = 1; i < argc; i++)
......@@ -401,9 +407,14 @@ int wmain(int argc, WCHAR *argvW[])
if (argc < 3)
{
reg_message(STRING_DELETE_USAGE);
reg_message(STRING_INVALID_CMDLINE);
return 1;
}
else if (argc == 3 && !lstrcmpW(argvW[2], slashHelpW))
{
reg_message(STRING_DELETE_USAGE);
return 0;
}
key_name = argvW[2];
for (i = 1; i < argc; i++)
......@@ -426,9 +437,14 @@ int wmain(int argc, WCHAR *argvW[])
if (argc < 3)
{
reg_message(STRING_QUERY_USAGE);
reg_message(STRING_INVALID_CMDLINE);
return 1;
}
else if (argc == 3 && !lstrcmpW(argvW[2], slashHelpW))
{
reg_message(STRING_QUERY_USAGE);
return 0;
}
key_name = argvW[2];
for (i = 1; i < argc; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment