aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'reader.cpp')
-rw-r--r--reader.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/reader.cpp b/reader.cpp
index 795b5fcc..4f3cb7b5 100644
--- a/reader.cpp
+++ b/reader.cpp
@@ -1309,7 +1309,6 @@ wcstring completion_apply_to_command_line(const wcstring &val_str, complete_flag
{
size_t move_cursor;
const wchar_t *begin, *end;
- wchar_t *escaped;
const wchar_t *buff = command_line.c_str();
parse_util_token_extent(buff, cursor_pos, &begin, 0, 0, 0);
@@ -1321,10 +1320,9 @@ wcstring completion_apply_to_command_line(const wcstring &val_str, complete_flag
{
/* Respect COMPLETE_DONT_ESCAPE_TILDES */
bool no_tilde = !!(flags & COMPLETE_DONT_ESCAPE_TILDES);
- escaped = escape(val, ESCAPE_ALL | ESCAPE_NO_QUOTED | (no_tilde ? ESCAPE_NO_TILDE : 0));
+ wcstring escaped = escape(val, ESCAPE_ALL | ESCAPE_NO_QUOTED | (no_tilde ? ESCAPE_NO_TILDE : 0));
sb.append(escaped);
- move_cursor = wcslen(escaped);
- free(escaped);
+ move_cursor = escaped.size();
}
else
{