From 82246874d2878692f123d29b5b45bfa1b8630064 Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Fri, 5 May 2017 09:42:33 +0000 Subject: [PATCH] regedit: Merge processRegLinesA/W() into their caller. Signed-off-by: Hugh McMaster Signed-off-by: Alexandre Julliard --- programs/regedit/regproc.c | 41 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index bb05ebf4a5e..01c9c76a93f 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -745,22 +745,6 @@ cleanup: return NULL; } -static BOOL processRegLinesA(FILE *fp, WCHAR *(*get_line)(FILE *), int reg_version) -{ - WCHAR *line; - - while ((line = get_line(fp))) - { - if (reg_version == REG_VERSION_31) - processRegEntry31(line); - else - processRegEntry(line, FALSE); - } - - closeKey(); - return TRUE; -} - static WCHAR *get_lineW(FILE *fp) { static size_t size; @@ -830,17 +814,6 @@ cleanup: return NULL; } -static BOOL processRegLinesW(FILE *fp, WCHAR *(*get_line)(FILE *)) -{ - WCHAR *line; - - while ((line = get_line(fp))) - processRegEntry(line, TRUE); - - closeKey(); - return TRUE; -} - /****************************************************************************** * Checks whether the buffer has enough room for the string or required size. * Resizes the buffer if necessary. @@ -1346,10 +1319,16 @@ BOOL import_registry_file(FILE* reg_file) return reg_version == REG_VERSION_FUZZY; } - if (is_unicode) - return processRegLinesW(reg_file, get_lineW); - else - return processRegLinesA(reg_file, get_lineA, reg_version); + while ((line = get_line(reg_file))) + { + if (reg_version == REG_VERSION_31) + processRegEntry31(line); + else + processRegEntry(line, is_unicode); + } + + closeKey(); + return TRUE; } /******************************************************************************