[v2 PATCH] ucrtbase: Implement _get_narrow_winmain_command_line/_get_wide_winmain_command_line

Dmitry Timoshkov dmitry at baikal.ru
Mon Jul 25 21:32:45 CDT 2016


Nikolay Sivov <nsivov at codeweavers.com> wrote:

> +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 == '"')
> +  {
> +      /* skip all leading quotes */
> +      while (*++s == '"')
> +          ;
> +      /* skip everything up to next quote */
> +      while (*s && *s++ != '"')
> +          ;
> +  }
> +  else
> +  {
> +      while (*s && *s != ' ' && *s != '\t')
> +      {
> +          /* allow embedded quoted blocks */
> +          if (*s == '"')
> +          {
> +              s++;
> +              while (*s && *s++ != '"')
> +                 ;
> +          }
> +          else
> +              s++;
> +      }
> +  }
> +  while (*s == ' ' || *s == '\t')
> +      s++;
> +
> +  return narrow_command_line = s;
> +}

Once again:
Where did you get an idea of such an implementation? Is this copied from
some place or based on some other implementation? Why for instance simple
'return GetCommandLineA()' is not enough as an initial implementation?

-- 
Dmitry.



More information about the wine-devel mailing list