[PATCH 1/5] start.exe: unquote the title

Zebediah Figura z.figura12 at gmail.com
Sat Aug 3 23:11:43 CDT 2019


Hello Damjan,

On 8/3/19 10:24 PM, Damjan Jovanovic wrote:
>  int wmain (int argc, WCHAR *argv[])
>  {
>  	SHELLEXECUTEINFOW sei;
> @@ -223,7 +242,13 @@ int wmain (int argc, WCHAR *argv[])
>  	for (i=1; i<argc; i++) {
>                  /* parse first quoted argument as console title */
>                  if (!title && argv[i][0] == '"') {
> -			title = argv[i];
> +			/* it will remove at least 1 quote */
> +			int maxChars = lstrlenW(argv[1]);
> +			title = HeapAlloc(GetProcessHeap(), 0, maxChars*sizeof(WCHAR));
> +			if (title)
> +				parse_title(argv[i], title, maxChars);
> +			else
> +				fatal_string(STRING_NOMEMFORTITLE);
>  			continue;
>  		}
>  		if (argv[i][0] != '/')

Is this really salient enough to warrant error handling? I wouldn't 
particularly imagine we're likely to run out of memory here.

If so, perhaps we should use FormatMessage() instead of introducing a 
new string resource.



More information about the wine-devel mailing list