reg: Fix behavior when specifying the help flag.

This commit is contained in:
Andrew Nguyen 2009-06-27 17:45:26 -05:00 committed by Alexandre Julliard
parent 24c6f5cc35
commit a3dbe3cce1

View File

@ -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++)