On Mon, 12 Apr 2021 02:22:36 +0200, Gijs Vermeulen wrote:
> @@ -1870,10 +1865,7 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
>
> /* Show prompt before batch line IF echo is on and in batch program */
> if (context && echo_mode && *curPos && (*curPos != '@')) {
> - static const WCHAR echoDot[] = {'e','c','h','o','.'};
> - static const WCHAR echoCol[] = {'e','c','h','o',':'};
> - static …
[View More]const WCHAR echoSlash[] = {'e','c','h','o','/'};
> - const DWORD len = ARRAY_SIZE(echoDot);
> + const DWORD len = ARRAY_SIZE(L"echo.") - 1;
This is very unusual. Why not just use lstrlenW(...)?
You should also look at calculating the string length within
WCMD_keyword_ws_found(), instead of passing the length as an argument.
But do this as a separate patch.
--
Hugh McMaster
[View Less]