From ce6d472a76019d466e4b99c85b0a864de7b3463d Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 31 Dec 2010 16:25:40 -0500 Subject: [PATCH] Fix some recent bugs in the special casing of :!. --- common/content/commands.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/content/commands.js b/common/content/commands.js index b1ec03e9..73fd1a74 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -1087,12 +1087,15 @@ var Commands = Module("commands", { str.replace(/\s*".*$/, ""); let matches = this.commandRegexp.exec(str); - if (!matches || !matches[4]) + if (!matches) return []; let [, spec, prespace, count, cmd, bang, space, args] = matches; - if (/\w/.test(cmd) && args && !(space || args[0] == "|")) - args = null; + if (!cmd && bang) + [cmd, bang] = [bang, cmd]; + + if (!cmd || args && args[0] != "|" && !(space || cmd == "!")) + return []; // parse count if (count)