[PATCH 2/3] reg: Ignore the slash zero character sequence if a custom separator is specified

Hugh McMaster hugh.mcmaster at outlook.com
Thu Feb 25 02:54:09 CST 2016


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 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 0155912..e66ba5a 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 151739c..efb2839 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);
 
-- 
1.9.1




More information about the wine-patches mailing list