From 6925cd5d888d40dc4180b088ed4e7d931d82ed62 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Thu, 25 Sep 2014 18:24:10 -0700 Subject: [PATCH] Escape the error string in process expansion errors This prevents `echo %*` from printing a private-use character in the error string. Fixes #1720. --- expand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expand.cpp b/expand.cpp index 3851d6b2a..351a84f16 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; } }