aboutsummaryrefslogtreecommitdiffhomepage
path: root/highlight.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-11-24 23:21:00 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-11-24 23:21:00 -0800
commit34540babdb6cc527a53003dcb5a13c961bf6ddc7 (patch)
tree2ceea618983a029e1634cd4bd389d626d3d74d3f /highlight.cpp
parent5d84e86d89e532d1a6979e2ed8528a05a7b7de9a (diff)
parent9f6223311e7ae6a9d6d21e33bf0fa67822da6fb6 (diff)
Merge branch 'master' into ast
Conflicts: complete.cpp fish_tests.cpp
Diffstat (limited to 'highlight.cpp')
-rw-r--r--highlight.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/highlight.cpp b/highlight.cpp
index 3acaf496..23fe912b 100644
--- a/highlight.cpp
+++ b/highlight.cpp
@@ -762,8 +762,8 @@ bool autosuggest_suggest_special(const wcstring &str, const wcstring &working_di
out_suggestion.clear();
/* Unescape the parameter */
- wcstring unescaped_dir = escaped_dir;
- bool unescaped = unescape_string(unescaped_dir, UNESCAPE_INCOMPLETE);
+ wcstring unescaped_dir;
+ bool unescaped = unescape_string(escaped_dir, &unescaped_dir, UNESCAPE_INCOMPLETE);
/* Determine the quote type we got from the input directory. */
wchar_t quote = L'\0';
@@ -1349,12 +1349,13 @@ void highlight_shell_classic(const wcstring &buff, std::vector<int> &color, size
if (tok_begin && tok_end)
{
wcstring token(tok_begin, tok_end-tok_begin);
- const wcstring_list_t working_directory_list(1, working_directory);
- if (unescape_string(token, 1))
+ if (unescape_string_in_place(&token, UNESCAPE_SPECIAL))
{
/* Big hack: is_potential_path expects a tilde, but unescape_string gives us HOME_DIRECTORY. Put it back. */
if (! token.empty() && token.at(0) == HOME_DIRECTORY)
token.at(0) = L'~';
+
+ const wcstring_list_t working_directory_list(1, working_directory);
if (is_potential_path(token, working_directory_list, PATH_EXPAND_TILDE))
{
for (ptrdiff_t i=tok_begin-cbuff; i < (tok_end-cbuff); i++)
@@ -1797,7 +1798,7 @@ static bool node_is_potential_path(const wcstring &src, const parse_node_t &node
/* Get the node source, unescape it, and then pass it to is_potential_path along with the working directory (as a one element list) */
bool result = false;
wcstring token(src, node.source_start, node.source_length);
- if (unescape_string(token, 1))
+ if (unescape_string_in_place(&token, UNESCAPE_SPECIAL))
{
/* Big hack: is_potential_path expects a tilde, but unescape_string gives us HOME_DIRECTORY. Put it back. */
if (! token.empty() && token.at(0) == HOME_DIRECTORY)