Commit 3c340fda authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

reg: Fail when /d is used without an accompanying argument.

parent 2c0359fb
...@@ -562,7 +562,13 @@ int wmain(int argc, WCHAR *argvW[]) ...@@ -562,7 +562,13 @@ int wmain(int argc, WCHAR *argvW[])
else if (!lstrcmpiW(argvW[i], slashSW)) else if (!lstrcmpiW(argvW[i], slashSW))
separator = argvW[++i][0]; separator = argvW[++i][0];
else if (!lstrcmpiW(argvW[i], slashDW)) else if (!lstrcmpiW(argvW[i], slashDW))
data = argvW[++i]; {
if (!(data = argvW[++i]))
{
output_message(STRING_INVALID_CMDLINE);
return 1;
}
}
else if (!lstrcmpiW(argvW[i], slashFW)) else if (!lstrcmpiW(argvW[i], slashFW))
force = TRUE; force = TRUE;
} }
......
...@@ -169,7 +169,7 @@ static void test_add(void) ...@@ -169,7 +169,7 @@ static void test_add(void)
verify_reg(hkey, "test", REG_SZ, "", 1, TODO_REG_SIZE); verify_reg(hkey, "test", REG_SZ, "", 1, TODO_REG_SIZE);
run_reg_exe("reg add HKCU\\" KEY_BASE " /v test1 /t REG_SZ /f /d", &r); run_reg_exe("reg add HKCU\\" KEY_BASE " /v test1 /t REG_SZ /f /d", &r);
todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
run_reg_exe("reg add HKEY_CURRENT_USER\\" KEY_BASE " /ve /d WineTEST /f", &r); run_reg_exe("reg add HKEY_CURRENT_USER\\" KEY_BASE " /ve /d WineTEST /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
...@@ -242,7 +242,7 @@ static void test_add(void) ...@@ -242,7 +242,7 @@ static void test_add(void)
verify_reg(hkey, "bin5", REG_BINARY, buffer, 0, 0); verify_reg(hkey, "bin5", REG_BINARY, buffer, 0, 0);
run_reg_exe("reg add HKCU\\" KEY_BASE " /v bin6 /t REG_BINARY /f /d", &r); run_reg_exe("reg add HKCU\\" KEY_BASE " /v bin6 /t REG_BINARY /f /d", &r);
todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
/* REG_DWORD */ /* REG_DWORD */
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_DWORD /f /d 12345678", &r); run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_DWORD /f /d 12345678", &r);
...@@ -255,7 +255,7 @@ static void test_add(void) ...@@ -255,7 +255,7 @@ static void test_add(void)
win_skip("broken reg.exe detected\n"); win_skip("broken reg.exe detected\n");
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword0 /t REG_DWORD /f /d", &r); run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword0 /t REG_DWORD /f /d", &r);
todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword1 /t REG_DWORD /f", &r); run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword1 /t REG_DWORD /f", &r);
todo_wine ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), todo_wine ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */),
"got exit code %d, expected 1\n", r); "got exit code %d, expected 1\n", r);
...@@ -353,7 +353,7 @@ static void test_add(void) ...@@ -353,7 +353,7 @@ static void test_add(void)
verify_reg(hkey, "multi11", REG_MULTI_SZ, buffer, 3, TODO_REG_SIZE); verify_reg(hkey, "multi11", REG_MULTI_SZ, buffer, 3, TODO_REG_SIZE);
run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi12 /t REG_MULTI_SZ /f /d", &r); run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi12 /t REG_MULTI_SZ /f /d", &r);
todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
RegCloseKey(hkey); RegCloseKey(hkey);
......
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