Hugh McMaster : regedit: Correctly import hex values with no data.
Alexandre Julliard
julliard at winehq.org
Mon Oct 16 14:38:31 CDT 2017
Module: wine
Branch: master
Commit: 84dda235365fbd0a705a9e7e229fb7744e85b0b7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=84dda235365fbd0a705a9e7e229fb7744e85b0b7
Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date: Mon Oct 16 10:27:25 2017 +0000
regedit: Correctly import hex values with no data.
Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/regedit/regproc.c | 4 ++++
programs/regedit/tests/regedit.c | 8 ++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c
index 508a8a3..a70a6d1 100644
--- a/programs/regedit/regproc.c
+++ b/programs/regedit/regproc.c
@@ -885,6 +885,9 @@ static WCHAR *hex_data_state(struct parser *parser, WCHAR *pos)
{
WCHAR *line = pos;
+ if (!*line)
+ goto set_value;
+
if (!convert_hex_csv_to_hex(parser, &line))
goto invalid;
@@ -896,6 +899,7 @@ static WCHAR *hex_data_state(struct parser *parser, WCHAR *pos)
prepare_hex_string_data(parser);
+set_value:
set_state(parser, SET_VALUE);
return line;
diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c
index b1f30b2..334360b 100644
--- a/programs/regedit/tests/regedit.c
+++ b/programs/regedit/tests/regedit.c
@@ -662,10 +662,10 @@ static void test_basic_import(void)
"\"Wine22h\"=hex:\n"
"\"Wine22i\"=hex(0):\n\n");
verify_reg(hkey, "Wine22a", REG_SZ, NULL, 0, 0);
- verify_reg(hkey, "Wine22b", REG_EXPAND_SZ, NULL, 0, TODO_REG_SIZE);
+ verify_reg(hkey, "Wine22b", REG_EXPAND_SZ, NULL, 0, 0);
verify_reg(hkey, "Wine22c", REG_BINARY, NULL, 0, 0);
verify_reg(hkey, "Wine22d", REG_DWORD, NULL, 0, 0);
- verify_reg(hkey, "Wine22e", REG_MULTI_SZ, NULL, 0, TODO_REG_SIZE);
+ verify_reg(hkey, "Wine22e", REG_MULTI_SZ, NULL, 0, 0);
verify_reg(hkey, "Wine22f", 0x100, NULL, 0, 0);
verify_reg(hkey, "Wine22g", 0xabcd, NULL, 0, 0);
verify_reg(hkey, "Wine22h", REG_BINARY, NULL, 0, 0);
@@ -1077,10 +1077,10 @@ static void test_basic_import_unicode(void)
"\"Wine22h\"=hex:\n"
"\"Wine22i\"=hex(0):\n\n");
verify_reg(hkey, "Wine22a", REG_SZ, NULL, 0, 0);
- verify_reg(hkey, "Wine22b", REG_EXPAND_SZ, NULL, 0, TODO_REG_SIZE);
+ verify_reg(hkey, "Wine22b", REG_EXPAND_SZ, NULL, 0, 0);
verify_reg(hkey, "Wine22c", REG_BINARY, NULL, 0, 0);
verify_reg(hkey, "Wine22d", REG_DWORD, NULL, 0, 0);
- verify_reg(hkey, "Wine22e", REG_MULTI_SZ, NULL, 0, TODO_REG_SIZE);
+ verify_reg(hkey, "Wine22e", REG_MULTI_SZ, NULL, 0, 0);
verify_reg(hkey, "Wine22f", 0x100, NULL, 0, 0);
verify_reg(hkey, "Wine22g", 0xabcd, NULL, 0, 0);
verify_reg(hkey, "Wine22h", REG_BINARY, NULL, 0, 0);
More information about the wine-cvs
mailing list