fix escape sequences in quoted resolve

This commit is contained in:
zawz 2021-06-23 15:53:08 +02:00
parent f80594d292
commit d461f625e8

View file

@ -277,8 +277,11 @@ std::pair< std::vector<arg*> , bool > resolve_arg(arg* in, parse_context ctx, bo
if(tsh->quoted || forcequote) if(tsh->quoted || forcequote)
{ {
stringReplace(fulltext, "\"", "\\\""); fulltext = stringReplace(fulltext, "\\\"", "\\\\\"");
stringReplace(fulltext, "!", "\\!"); fulltext = stringReplace(fulltext, "\"", "\\\"");
fulltext = stringReplace(fulltext, "!", "\"\\!\"");
fulltext = stringReplace(fulltext, "$", "\\$");
fulltext = stringReplace(fulltext, "`", "\\`");
} }
if(!tsh->quoted && forcequote) if(!tsh->quoted && forcequote)
fulltext = '"' + fulltext + '"'; fulltext = '"' + fulltext + '"';