Large cleanup and refactoring of unescape() function.

This commit is contained in:
ridiculousfish
2013-11-24 22:57:49 -08:00
parent 90b78326d3
commit 9f6223311e
13 changed files with 633 additions and 117 deletions

View File

@@ -1982,13 +1982,10 @@ void complete(const wcstring &cmd, std::vector<completion_t> &comps, completion_
{
bool do_file = false;
wcstring current_command_unescape = current_command;
wcstring prev_token_unescape = prev_token;
wcstring current_token_unescape = current_token;
if (unescape_string(current_command_unescape, 0) &&
unescape_string(prev_token_unescape, 0) &&
unescape_string(current_token_unescape, UNESCAPE_INCOMPLETE))
wcstring current_command_unescape, prev_token_unescape, current_token_unescape;
if (unescape_string(current_command, &current_command_unescape, UNESCAPE_DEFAULT) &&
unescape_string(prev_token, &prev_token_unescape, UNESCAPE_DEFAULT) &&
unescape_string(current_token, &current_token_unescape, UNESCAPE_INCOMPLETE))
{
do_file = completer.complete_param(current_command_unescape,
prev_token_unescape,