[PATCH] ucrtbase: Implement _get_narrow_winmain_command_line/_get_wide_winmain_command_line
Piotr Caban
piotr.caban at gmail.com
Mon Jul 25 08:13:26 CDT 2016
On 07/24/16 20:40, Nikolay Sivov wrote:
> +/*********************************************************************
> + * _get_narrow_winmain_command_line (UCRTBASE.@)
> + */
> +char* CDECL _get_narrow_winmain_command_line(void)
> +{
> + static char *narrow_command_line;
> + char *s;
> +
> + if (narrow_command_line)
> + return narrow_command_line;
> +
> + s = GetCommandLineA();
> + if (*s == '"')
> + {
> + s++;
> + while (*s)
> + if (*s++ == '"')
> + break;
> + }
> + else
> + {
> + while (*s && *s != ' ' && *s != '\t')
> + s++;
> + }
> + while (*s == ' ' || *s == '\t')
> + s++;
> +
> + return narrow_command_line = s;
> +}
It will not work in following case (executable name "test ws.exe"):
CMD> test" "ws.exe other args
or
CMD> """test ws.exe" other args
Probably there's no real use case for that but it shouldn't be hard to
handle this cases as well.
Thanks,
Piotr
More information about the wine-devel
mailing list