From d0bd238657e4179155a71a44f3a4d8eb04ef8937 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 24 May 2019 18:17:48 +0200 Subject: [PATCH] Don't hardcode enum numbers "1" in the context of `escape_string(..., 1)` is referring to `ESCAPE_ALL`, so we should use that. --- src/complete.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/complete.cpp b/src/complete.cpp index 82256a123..d880bb46b 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -593,7 +593,7 @@ void completer_t::complete_cmd_desc(const wcstring &str) { } wcstring lookup_cmd(L"__fish_describe_command "); - lookup_cmd.append(escape_string(cmd, 1)); + lookup_cmd.append(escape_string(cmd, ESCAPE_ALL)); // First locate a list of possible descriptions using a single call to apropos or a direct // search if we know the location of the whatis database. This can take some time on slower @@ -1603,7 +1603,7 @@ void complete(const wcstring &cmd_with_subcmds, std::vector *out_c static void append_switch(wcstring &out, const wcstring &opt, const wcstring &argument) { if (argument.empty()) return; - wcstring esc = escape_string(argument, 1); + wcstring esc = escape_string(argument, ESCAPE_ALL); append_format(out, L" --%ls %ls", opt.c_str(), esc.c_str()); }