16 Jan
2026
16 Jan
'26
10:01 a.m.
eric pouech (@epo) commented about dlls/kernelbase/process.c:
if (cmdline[0] == '"' && (p = wcschr( cmdline + 1, '"' ))) { - int len = p - cmdline - 1; + int len; + /* trim spaces in quotes */ + const WCHAR* start = cmdline + 1; + const WCHAR* end = p - 1; + while (*end == ' ' && end > start) end--; + if (end < start)
doesn't look good... 'end' can never be \< start (from line above), at worst it's == start advice: I'd rather write it as (not tested) `int len = p - cmdline - 1` `while (len && cmdline[1 + len - 1] == L' ') len--;` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9882#note_127186