reg: Fail if /v is passed without an argument.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2b740588ba
commit
735dca6074
|
@ -601,7 +601,13 @@ int wmain(int argc, WCHAR *argvW[])
|
|||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if (!lstrcmpiW(argvW[i], slashVW))
|
||||
value_name = argvW[++i];
|
||||
{
|
||||
if (!(value_name = argvW[++i]))
|
||||
{
|
||||
output_message(STRING_INVALID_CMDLINE);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (!lstrcmpiW(argvW[i], slashVEW))
|
||||
value_empty = TRUE;
|
||||
else if (!lstrcmpiW(argvW[i], slashTW))
|
||||
|
@ -652,7 +658,13 @@ int wmain(int argc, WCHAR *argvW[])
|
|||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if (!lstrcmpiW(argvW[i], slashVW))
|
||||
value_name = argvW[++i];
|
||||
{
|
||||
if (!(value_name = argvW[++i]))
|
||||
{
|
||||
output_message(STRING_INVALID_CMDLINE);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (!lstrcmpiW(argvW[i], slashVEW))
|
||||
value_empty = TRUE;
|
||||
else if (!lstrcmpiW(argvW[i], slashVAW))
|
||||
|
@ -683,7 +695,13 @@ int wmain(int argc, WCHAR *argvW[])
|
|||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if (!lstrcmpiW(argvW[i], slashVW))
|
||||
value_name = argvW[++i];
|
||||
{
|
||||
if (!(value_name = argvW[++i]))
|
||||
{
|
||||
output_message(STRING_INVALID_CMDLINE);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (!lstrcmpiW(argvW[i], slashVEW))
|
||||
value_empty = TRUE;
|
||||
else if (!lstrcmpiW(argvW[i], slashSW))
|
||||
|
|
|
@ -519,6 +519,19 @@ static void test_v_flags(void)
|
|||
|
||||
run_reg_exe("reg delete HKCU\\" KEY_BASE " /ve /va", &r);
|
||||
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
|
||||
|
||||
/* No /v argument */
|
||||
run_reg_exe("reg add HKCU\\" KEY_BASE " /v", &r);
|
||||
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
|
||||
|
||||
run_reg_exe("reg add HKCU\\" KEY_BASE " /d Test /f /v", &r);
|
||||
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
|
||||
|
||||
run_reg_exe("reg delete HKCU\\" KEY_BASE " /v", &r);
|
||||
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
|
||||
|
||||
run_reg_exe("reg delete HKCU\\" KEY_BASE " /f /v", &r);
|
||||
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
|
||||
}
|
||||
|
||||
START_TEST(reg)
|
||||
|
|
Loading…
Reference in New Issue