regedit: Replace error_unknown_switch() with simpler error handling.

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-06-22 12:02:56 +00:00 committed by Alexandre Julliard
parent 3e8d4e3103
commit 7e72247d07
1 changed files with 4 additions and 20 deletions

View File

@ -230,24 +230,6 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
return TRUE; return TRUE;
} }
/**
* Process unknown switch.
*
* Params:
* chu - the switch character in upper-case.
* s - the command line string where s points to the switch character.
*/
static void error_unknown_switch(char chu, char *s)
{
if (isalpha(chu)) {
fprintf(stderr,"%s: Undefined switch /%c!\n", getAppName(), chu);
} else {
fprintf(stderr,"%s: Alphabetic character is expected after '%c' "
"in switch specification\n", getAppName(), *(s - 1));
}
exit(1);
}
BOOL ProcessCmdLine(LPSTR lpCmdLine) BOOL ProcessCmdLine(LPSTR lpCmdLine)
{ {
REGEDIT_ACTION action = ACTION_UNDEF; REGEDIT_ACTION action = ACTION_UNDEF;
@ -284,7 +266,8 @@ BOOL ProcessCmdLine(LPSTR lpCmdLine)
exit(0); exit(0);
break; break;
default: default:
error_unknown_switch(chu, s); fprintf(stderr, "regedit: Invalid or unrecognized switch [/%c]\n", chu);
exit(1);
break; break;
} }
} }
@ -301,7 +284,8 @@ BOOL ProcessCmdLine(LPSTR lpCmdLine)
} }
break; break;
default: default:
error_unknown_switch(chu, s); fprintf(stderr, "regedit: Invalid or unrecognized switch [/%c]\n", chu);
exit(1);
break; break;
} }
} else { } else {