From: Joe Souza jsouza@yahoo.com
--- programs/cmd/wcmdmain.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index e9c5be4ceb3..c178c2a5cb9 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -138,7 +138,7 @@ static void build_search_string(WCHAR *inputBuffer, int len, SEARCH_CONTEXT *sc) * Otherwise, parse the buffer to find the last parameter in the buffer, * where tab was pressed. */ - if (len && inputBuffer[len-1] == L' ') { + if (len && (inputBuffer[len-1] == L' ' || inputBuffer[len-1] == L'+')) { cc = len; } else { /* Handle spaces in directory names. Need to quote paths if they contain spaces. @@ -150,7 +150,8 @@ static void build_search_string(WCHAR *inputBuffer, int len, SEARCH_CONTEXT *sc) if (stripped_copy) { wcsncpy_s(last_stripped_copy, ARRAY_SIZE(last_stripped_copy), stripped_copy, _TRUNCATE); } - stripped_copy = WCMD_parameter(inputBuffer, nn++, ¶m, FALSE, FALSE); + /* Delimiters here are the same as specified in WCMD_parameter, but with '+' added. */ + stripped_copy = WCMD_parameter_with_delims(inputBuffer, nn++, ¶m, FALSE, FALSE, L" \t,=;+"); } while (param);
if (last_param) { @@ -189,11 +190,11 @@ static void find_insert_pos(const WCHAR *inputBuffer, int len, SEARCH_CONTEXT *s /* Handle paths here. Find last '\'. * If '\' isn't found then insert pos is the same as search pos. */ - while (cc > sc->search_pos && inputBuffer[cc] != L'\') { + while (cc > sc->search_pos && inputBuffer[cc] != L'+' && inputBuffer[cc] != L'\') { cc--; }
- if (inputBuffer[cc] == L'"' || inputBuffer[cc] == L'\') { + if (inputBuffer[cc] == L'"' || inputBuffer[cc] == L'+' || inputBuffer[cc] == L'\') { cc++; }