From 11b096f3fd386128bb8e71b964703336e8d15503 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Mon, 18 Oct 2010 20:35:59 -0400 Subject: [PATCH] Deal with Vimperator issue 425. --- common/content/commands.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/content/commands.js b/common/content/commands.js index 4369498e..24eeaedc 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -903,7 +903,7 @@ const Commands = Module("commands", { } else if (count == -1) fail("Error parsing arguments: " + arg); - else if (!onlyArgumentsRemaining && /^-/.test(arg)) + else if (!onlyArgumentsRemaining && sub[0] === "-") fail("Invalid option: " + arg); if (arg != null) @@ -1113,7 +1113,7 @@ const Commands = Module("commands", { return [len - str.length, arg, quote]; }, - quote: function quote(str) Commands.quoteArg[/[\s"'\\]|^$/.test(str) + quote: function quote(str) Commands.quoteArg[/[\s"'\\]|^$|^-/.test(str) ? (/[\b\f\n\r\t]/.test(str) ? '"' : "'") : ""](str) }, {