1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00

notepad: Only skip valid command options.

Signed-off-by: Bruno Jesus <00cpxxx@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Bruno Jesus 2017-01-31 01:31:33 -02:00 committed by Alexandre Julliard
parent 57b83e1459
commit bd19402b6d

View File

@ -615,7 +615,7 @@ static int AlertFileDoesNotExist(LPCWSTR szFileName)
static void HandleCommandLine(LPWSTR cmdline) static void HandleCommandLine(LPWSTR cmdline)
{ {
WCHAR delimiter; WCHAR delimiter, *ptr;
BOOL opt_print = FALSE; BOOL opt_print = FALSE;
/* skip white space */ /* skip white space */
@ -630,22 +630,29 @@ static void HandleCommandLine(LPWSTR cmdline)
if (*cmdline == delimiter) cmdline++; if (*cmdline == delimiter) cmdline++;
while (*cmdline == ' ' || *cmdline == '-' || *cmdline == '/') ptr = cmdline;
while (*ptr == ' ' || *ptr == '-' || *ptr == '/')
{ {
WCHAR option; WCHAR option;
if (*cmdline++ == ' ') continue; if (*ptr++ == ' ') continue;
option = *cmdline; option = *ptr;
if (option) cmdline++; if (option) ptr++;
while (*cmdline == ' ') cmdline++; while (*ptr == ' ') ptr++;
switch(option) switch(option)
{ {
case 'p': case 'p':
case 'P': case 'P':
opt_print = TRUE; {
if (!opt_print)
{
opt_print = TRUE;
cmdline = ptr;
}
break; break;
}
} }
} }