1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 18:07:58 +01:00

Fix serialization of commands with embedded new lines in their args but no heredoc support.

This commit is contained in:
Kris Maglione
2010-10-16 19:16:47 -04:00
parent c96375d7ee
commit 89950aa226
2 changed files with 4 additions and 2 deletions

View File

@@ -409,7 +409,9 @@ const Commands = Module("commands", {
let str = args.literalArg;
if (str)
res.push(/\n/.test(str) ? "<<EOF\n" + str.replace(/\n$/, "") + "\nEOF" : str);
res.push(!/\n/.test(str) ? str :
this.hereDoc ? "<<EOF\n" + str.replace(/\n$/, "") + "\nEOF"
: str.replace(/\n/, "\n" + res[0].replace(/./g, " ").replace(/.$/, "\\")));
return res.join(" ");
},