Re: [PATCH v21 0/1] MR7843: cmd: Implement tab completion for command line entry.
eric pouech (@epo) commented about programs/cmd/lineedit.c:
+ } + oldCurPos = curPos; + curPos = 0; + while (curPos < len && + inputBuffer[curPos] != L'\t' && + inputBuffer[curPos] != L'\x1B' + ) { + + curPos++; + } + /* curPos is often numRead - 1, but not always, as in the case where history is retrieved + * and then user backspaces to somewhere mid-string and then hits Tab. + */ + TRACE("numRead: %lu, curPos: %u\n", *numRead, curPos); + + switch (inputBuffer[curPos]) { looks to be that curPos can be \> \*numRead, hence reading garbage in that case
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/7843#note_101933
participants (1)
-
eric pouech (@epo)