aboutsummaryrefslogtreecommitdiffhomepage
path: root/expand.cpp
diff options
context:
space:
mode:
authorGravatar Kevin Ballard <kevin@sb.org>2014-09-25 18:24:10 -0700
committerGravatar Kevin Ballard <kevin@sb.org>2014-09-25 18:24:10 -0700
commit6925cd5d888d40dc4180b088ed4e7d931d82ed62 (patch)
tree96d3afbe7b796123e8a792fa006316ce13fac1e5 /expand.cpp
parent35595dbffdf413694b31da46129432ef345921af (diff)
Escape the error string in process expansion errors
This prevents `echo %*` from printing a private-use character in the error string. Fixes #1720.
Diffstat (limited to 'expand.cpp')
-rw-r--r--expand.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/expand.cpp b/expand.cpp
index 3851d6b2..351a84f1 100644
--- a/expand.cpp
+++ b/expand.cpp
@@ -860,7 +860,7 @@ static bool expand_pid(const wcstring &instr_with_sep, expand_flags_t flags, std
if (!(flags & ACCEPT_INCOMPLETE))
{
/* We failed to find anything */
- append_syntax_error(errors, 1, FAILED_EXPANSION_PROCESS_ERR_MSG, in+1);
+ append_syntax_error(errors, 1, FAILED_EXPANSION_PROCESS_ERR_MSG, escape(in+1, ESCAPE_NO_QUOTED).c_str());
return false;
}
}