mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 07:37:09 +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:
parent
57b83e1459
commit
bd19402b6d
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue