From d461f625e8b1d02a1183ade89523bf04cf3e3678 Mon Sep 17 00:00:00 2001 From: zawz Date: Wed, 23 Jun 2021 15:53:08 +0200 Subject: [PATCH] fix escape sequences in quoted resolve --- src/resolve.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/resolve.cpp b/src/resolve.cpp index e1c4026..9755f33 100644 --- a/src/resolve.cpp +++ b/src/resolve.cpp @@ -277,8 +277,11 @@ std::pair< std::vector , bool > resolve_arg(arg* in, parse_context ctx, bo if(tsh->quoted || forcequote) { - stringReplace(fulltext, "\"", "\\\""); - stringReplace(fulltext, "!", "\\!"); + fulltext = stringReplace(fulltext, "\\\"", "\\\\\""); + fulltext = stringReplace(fulltext, "\"", "\\\""); + fulltext = stringReplace(fulltext, "!", "\"\\!\""); + fulltext = stringReplace(fulltext, "$", "\\$"); + fulltext = stringReplace(fulltext, "`", "\\`"); } if(!tsh->quoted && forcequote) fulltext = '"' + fulltext + '"';