Hugh McMaster : regedit: Skip any leading spaces and tabs that may be present in the line being parsed.
Module: wine Branch: master Commit: aacae1960299875160f1552b45bc3e3c3e2527a1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=aacae1960299875160f1552b45... Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Mon Apr 3 12:02:14 2017 +0000 regedit: Skip any leading spaces and tabs that may be present in the line being parsed. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/regedit/regproc.c | 2 ++ programs/regedit/tests/regedit.c | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index 5610c87..e0049c6 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -748,6 +748,7 @@ static char *get_lineA(FILE *fp) next = line; continue; } + while (*line == ' ' || *line == '\t') line++; if (*line == ';' || *line == '#') { line = next; @@ -859,6 +860,7 @@ static WCHAR *get_lineW(FILE *fp) next = line; continue; } + while (*line == ' ' || *line == '\t') line++; if (*line == ';' || *line == '#') { line = next; diff --git a/programs/regedit/tests/regedit.c b/programs/regedit/tests/regedit.c index 354ddac..bbe5c4b 100644 --- a/programs/regedit/tests/regedit.c +++ b/programs/regedit/tests/regedit.c @@ -673,32 +673,32 @@ static void test_import_with_whitespace(void) exec_import_str("REGEDIT4\n\n" " [HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Wine2a\"=\"Value\"\n\n"); - todo_wine verify_reg(hkey, "Wine2a", REG_SZ, "Value", 6, 0); + verify_reg(hkey, "Wine2a", REG_SZ, "Value", 6, 0); exec_import_str("REGEDIT4\n\n" "\t[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Wine2b\"=\"Value\"\n\n"); - todo_wine verify_reg(hkey, "Wine2b", REG_SZ, "Value", 6, 0); + verify_reg(hkey, "Wine2b", REG_SZ, "Value", 6, 0); exec_import_str("REGEDIT4\n\n" " \t [HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\"Wine2c\"=\"Value\"\n\n"); - todo_wine verify_reg(hkey, "Wine2c", REG_SZ, "Value", 6, 0); + verify_reg(hkey, "Wine2c", REG_SZ, "Value", 6, 0); exec_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" " \"Wine3a\"=\"Two leading spaces\"\n\n"); - todo_wine verify_reg(hkey, "Wine3a", REG_SZ, "Two leading spaces", 19, 0); + verify_reg(hkey, "Wine3a", REG_SZ, "Two leading spaces", 19, 0); exec_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" "\t\"Wine3b\"=\"One leading tab\"\n\n"); - todo_wine verify_reg(hkey, "Wine3b", REG_SZ, "One leading tab", 16, 0); + verify_reg(hkey, "Wine3b", REG_SZ, "One leading tab", 16, 0); exec_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" " \t \"Wine3c\"=\"Space, tab, space\"\n\n"); - todo_wine verify_reg(hkey, "Wine3c", REG_SZ, "Space, tab, space", 18, 0); + verify_reg(hkey, "Wine3c", REG_SZ, "Space, tab, space", 18, 0); exec_import_str(" REGEDIT4\n\n" "\t\t\t[HKEY_CURRENT_USER\\" KEY_BASE "]\n" @@ -708,9 +708,9 @@ static void test_import_with_whitespace(void) " 63,6f,6e,\\;comment\n" "\t\t\t\t63,61,74,\\;comment\n" " \t65,6e,61,74,69,6f,6e,00,00\n\n"); - todo_wine verify_reg(hkey, "Wine4a", REG_SZ, "Tab and four spaces", 20, 0); + verify_reg(hkey, "Wine4a", REG_SZ, "Tab and four spaces", 20, 0); dword = 0x112233; - todo_wine verify_reg(hkey, "Wine4b", REG_DWORD, &dword, sizeof(dword), 0); + verify_reg(hkey, "Wine4b", REG_DWORD, &dword, sizeof(dword), 0); todo_wine verify_reg(hkey, "Wine4c", REG_MULTI_SZ, "Line concatenation\0", 20, 0); exec_import_str(" REGEDIT4\n\n" @@ -719,10 +719,10 @@ static void test_import_with_whitespace(void) "\t\t\"Wine5b\"\t\t=\"Leading tabs\"\n" "\t \"Wine5c\"=\t \"Tabs and spaces\"\n" " \"Wine5d\" \t = \t \"More whitespace\"\n\n"); - todo_wine verify_reg(hkey, "Wine5a", REG_SZ, "Leading spaces", 15, 0); - todo_wine verify_reg(hkey, "Wine5b", REG_SZ, "Leading tabs", 13, 0); - todo_wine verify_reg(hkey, "Wine5c", REG_SZ, "Tabs and spaces", 16, 0); - todo_wine verify_reg(hkey, "Wine5d", REG_SZ, "More whitespace", 16, 0); + verify_reg(hkey, "Wine5a", REG_SZ, "Leading spaces", 15, 0); + verify_reg(hkey, "Wine5b", REG_SZ, "Leading tabs", 13, 0); + verify_reg(hkey, "Wine5c", REG_SZ, "Tabs and spaces", 16, 0); + verify_reg(hkey, "Wine5d", REG_SZ, "More whitespace", 16, 0); exec_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" @@ -731,7 +731,7 @@ static void test_import_with_whitespace(void) " \" Wine6c \" = \" Spaces everywhere \" \n\n"); verify_reg(hkey, " Wine6a", REG_SZ, "Leading spaces", 15, 0); verify_reg(hkey, "\t\tWine6b", REG_SZ, "Leading tabs", 13, 0); - todo_wine verify_reg(hkey, " Wine6c ", REG_SZ, " Spaces everywhere ", 22, 0); + verify_reg(hkey, " Wine6c ", REG_SZ, " Spaces everywhere ", 22, 0); exec_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
participants (1)
-
Alexandre Julliard