wordpad: Open the filename passed on command line if any.

This commit is contained in:
Eric Pouech 2008-04-26 13:33:24 +02:00 committed by Alexandre Julliard
parent 09c6bf415f
commit 2cf1925eb4
1 changed files with 16 additions and 13 deletions

View File

@ -1041,23 +1041,26 @@ static void HandleCommandLine(LPWSTR cmdline)
while (*cmdline && *cmdline != delimiter) cmdline++;
if (*cmdline == delimiter) cmdline++;
while (*cmdline == ' ' || *cmdline == '-' || *cmdline == '/')
while (*cmdline)
{
WCHAR option;
while (isspace(*cmdline)) cmdline++;
if (*cmdline++ == ' ') continue;
option = *cmdline;
if (option) cmdline++;
while (*cmdline == ' ') cmdline++;
switch (option)
if (*cmdline == '-' || *cmdline == '/')
{
case 'p':
case 'P':
opt_print = 1;
break;
if (!cmdline[2] || isspace(cmdline[2]))
{
switch (cmdline[1])
{
case 'P':
case 'p':
opt_print = 1;
cmdline += 2;
continue;
}
}
/* a filename starting by / */
}
break;
}
if (*cmdline)