LGTM two possible changes: * while rewriting code in cmd.exe, we tend to use 4 space indentation, and have opening curly brackets alone on their lines * for readability, we could not use 'pos' in the loop and do something like ``` /* Search forwards until find invalid character modifier */ for (lastModifier = firstModifier; *lastModifier && wcschr(validmodifiers, towlower(*lastModifier)); lastModifier++) { /* Special case '$' to skip until : found */ if (*lastModifier == L'$' && !(lastModifier = wcschr(lastModifier + 1, L':'))) return; /* Invalid syntax */ } ``` anyway, this function function will need some care (and reading the code, I really wonder if it always does what it's supposed to do, but more tests are needed, and this goes way beyond the aim of this MR) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/8543#note_109658