with this recent change, I have done the following: 1. Called `GetConsoleMode(hOut)` only once, right after getting `hOut` before the while loop storing it in `hOutAscii`. I changed the ordering while calling `WCMD_copy_loop` as well, to `hOutAscii || GetConsoleMode(hIn)`. The rationale is to avoid the (relatively)costly ioctl calls involved in `GetConsoleMode` by returning early if `hOutAscii` is set. 2. Added a check for `fileNamePart = PathFindFileNameW(thisArg)` which only computes it once. 3. Moved the shared flags to before the while loop, as this just seemed like unnecessary computation(should a const specifier be used here?) 4. Added a log statement that prints the string after wildcard expansion. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11094#note_145323