regedit: Correctly import hex values with no data.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Hugh McMaster 2017-10-16 10:27:25 +00:00 committed by Alexandre Julliard
parent 56b223adfa
commit 84dda23536
2 changed files with 8 additions and 4 deletions

View File

@ -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;

View File

@ -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);