From b57b998354a6ceaa1aae2c6e0864e96fd7f846fe Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Thu, 25 Feb 2016 19:54:09 +1100 Subject: [PATCH] reg: Ignore the slash zero character sequence if a custom separator is specified. Signed-off-by: Hugh McMaster Signed-off-by: Alexandre Julliard --- programs/reg/reg.c | 2 +- programs/reg/tests/reg.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/programs/reg/reg.c b/programs/reg/reg.c index 015591269b2..e66ba5ab1ad 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c @@ -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++) { - if (data[i] == '\\' && data[i + 1] == '0') + if (!separator && data[i] == '\\' && data[i + 1] == '0') { buffer[destindex] = 0; i++; diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c index 151739cb80c..efb28396258 100644 --- a/programs/reg/tests/reg.c +++ b/programs/reg/tests/reg.c @@ -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); 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); 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); 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);