Commit b57b9983 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

reg: Ignore the slash zero character sequence if a custom separator is specified.

parent 3cd90a43
...@@ -290,7 +290,7 @@ static LPBYTE get_regdata(LPWSTR data, DWORD reg_type, WCHAR separator, DWORD *r ...@@ -290,7 +290,7 @@ static LPBYTE get_regdata(LPWSTR data, DWORD reg_type, WCHAR separator, DWORD *r
for (i = 0, destindex = 0; i < len; i++, destindex++) for (i = 0, destindex = 0; i < len; i++, destindex++)
{ {
if (data[i] == '\\' && data[i + 1] == '0') if (!separator && data[i] == '\\' && data[i + 1] == '0')
{ {
buffer[destindex] = 0; buffer[destindex] = 0;
i++; i++;
......
...@@ -391,15 +391,15 @@ static void test_add(void) ...@@ -391,15 +391,15 @@ static void test_add(void)
run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi19 /t REG_MULTI_SZ /s \"#\" /d \"two\\0#strings\" /f", &r); run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi19 /t REG_MULTI_SZ /s \"#\" /d \"two\\0#strings\" /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r); ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
verify_reg(hkey, "multi19", REG_MULTI_SZ, "two\\0\0strings\0", 15, TODO_REG_SIZE|TODO_REG_DATA); verify_reg(hkey, "multi19", REG_MULTI_SZ, "two\\0\0strings\0", 15, 0);
run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi20 /t REG_MULTI_SZ /s \"#\" /d \"two#\\0strings\" /f", &r); run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi20 /t REG_MULTI_SZ /s \"#\" /d \"two#\\0strings\" /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r); ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
verify_reg(hkey, "multi20", REG_MULTI_SZ, "two\0\\0strings\0", 15, TODO_REG_SIZE|TODO_REG_DATA); verify_reg(hkey, "multi20", REG_MULTI_SZ, "two\0\\0strings\0", 15, 0);
run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi21 /t REG_MULTI_SZ /s \"#\" /d \"two\\0\\0strings\" /f", &r); run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi21 /t REG_MULTI_SZ /s \"#\" /d \"two\\0\\0strings\" /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r); ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r);
verify_reg(hkey, "multi21", REG_MULTI_SZ, "two\\0\\0strings\0", 16, TODO_REG_SIZE|TODO_REG_DATA); verify_reg(hkey, "multi21", REG_MULTI_SZ, "two\\0\\0strings\0", 16, 0);
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