regedit: Process the next file, if any, on error.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2016-07-05 09:13:35 +00:00 committed by Alexandre Julliard
parent 221bb0f769
commit 6ad44d7a31
1 changed files with 5 additions and 4 deletions

View File

@ -88,7 +88,7 @@ typedef enum {
ACTION_ADD, ACTION_EXPORT, ACTION_DELETE ACTION_ADD, ACTION_EXPORT, ACTION_DELETE
} REGEDIT_ACTION; } REGEDIT_ACTION;
static BOOL PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i) static void PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i)
{ {
switch (action) { switch (action) {
case ACTION_ADD: { case ACTION_ADD: {
@ -113,7 +113,8 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i)
if (size == 0) if (size == 0)
{ {
output_message(STRING_FILE_NOT_FOUND, filename); output_message(STRING_FILE_NOT_FOUND, filename);
exit(1); HeapFree(GetProcessHeap(), 0, realname);
return;
} }
reg_file = _wfopen(realname, rb_mode); reg_file = _wfopen(realname, rb_mode);
if (reg_file == NULL) if (reg_file == NULL)
@ -121,7 +122,8 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i)
WCHAR regedit[] = {'r','e','g','e','d','i','t',0}; WCHAR regedit[] = {'r','e','g','e','d','i','t',0};
_wperror(regedit); _wperror(regedit);
output_message(STRING_CANNOT_OPEN_FILE, filename); output_message(STRING_CANNOT_OPEN_FILE, filename);
exit(1); HeapFree(GetProcessHeap(), 0, realname);
return;
} }
import_registry_file(reg_file); import_registry_file(reg_file);
if (realname) if (realname)
@ -150,7 +152,6 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, WCHAR **argv, int *i)
exit(1); exit(1);
break; break;
} }
return TRUE;
} }
BOOL ProcessCmdLine(WCHAR *cmdline) BOOL ProcessCmdLine(WCHAR *cmdline)