Zebediah Figura (@zfigura) commented about dlls/kernelbase/path.c:
+ * First check for known, valid and typo free scheme + */ + for (pos=1; pos<ARRAY_SIZE(url_scheme); pos++) + { + len = wcslen(url_scheme[pos]); + if ( (len <= wcslen(url)) && (!_wcsnicmp(url, url_scheme[pos], len)) ) + { + /* + * check if string fits into maxChars + */ + if (len+1 >= maxChars) + return S_FALSE; + + lstrcpynW(save_str, url_scheme[pos], len+1); + url += len; + goto scheme_done; Can we use a helper function to fix up the scheme instead of using a goto? This will probably also help make the function easier to follow, by virtue of being less monolithic.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/1825#note_19809