diff --git a/content/commands.js b/content/commands.js index e4193509..b9930152 100644 --- a/content/commands.js +++ b/content/commands.js @@ -355,12 +355,12 @@ function Commands() //{{{ switch (quote) { case "'": - return function (str) "'" + str.substitute(/[\\']/g, "\\$&") + "'"; + return function (str) "'" + str.replace(/[\\']/g, "\\$&") + "'"; case '"': - return function (str) '"' + str.substitute(/[\\"\t\n]/g, + return function (str) '"' + str.replace(/[\\"\t\n]/g, function (c) (c == "\n" ? "\\n" : c == "\t" ? "\\t" : "\\" + c)); default: - return function (str) str.substitute(/[\\ ]/g, "\\$&"); + return function (str) str.replace(/[\\ ]/g, "\\$&"); } }