From 9d77c018caee149e495215a89d4d91cbbc83cc0d Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 19 Aug 2009 14:02:56 -0400 Subject: [PATCH] Fix something to do with . --- common/content/bookmarks.js | 18 ++++++++---------- common/content/browser.js | 0 common/content/commands.js | 7 ++++--- common/content/completion.js | 0 common/content/events.js | 0 common/content/hints.js | 0 common/content/io.js | 0 common/content/liberator.js | 0 common/content/mappings.js | 0 common/content/modes.js | 0 common/content/options.js | 0 common/content/style.js | 0 common/content/ui.js | 0 common/content/util.js | 0 xulmus/content/player.js | 0 15 files changed, 12 insertions(+), 13 deletions(-) mode change 100755 => 100644 common/content/bookmarks.js mode change 100755 => 100644 common/content/browser.js mode change 100755 => 100644 common/content/commands.js mode change 100755 => 100644 common/content/completion.js mode change 100755 => 100644 common/content/events.js mode change 100755 => 100644 common/content/hints.js mode change 100755 => 100644 common/content/io.js mode change 100755 => 100644 common/content/liberator.js mode change 100755 => 100644 common/content/mappings.js mode change 100755 => 100644 common/content/modes.js mode change 100755 => 100644 common/content/options.js mode change 100755 => 100644 common/content/style.js mode change 100755 => 100644 common/content/ui.js mode change 100755 => 100644 common/content/util.js mode change 100755 => 100644 xulmus/content/player.js diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js old mode 100755 new mode 100644 index a963b048..ed10dc1c --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -276,11 +276,7 @@ function Bookmarks() //{{{ "Open a prompt to bookmark the current URL", function () { - function quote(str) commands.quoteArg['"'](str) - - let title = ""; - let keyword = ""; - let tags = ""; + let options = {}; let bmarks = bookmarks.get(buffer.URL).filter(function (bmark) bmark.url == buffer.URL); @@ -288,19 +284,21 @@ function Bookmarks() //{{{ { let bmark = bmarks[0]; - title = " -title=" + quote(bmark.title); + options["-title"] = bmark.title; if (bmark.keyword) - keyword = " -keyword=\"" + bmark.keyword + "\""; + options["-keyword"] = bmark.keyword; if (bmark.tags.length > 0) - tags = " -tags=\"" + bmark.tags.join(", ") + "\""; + options["-tags"] = bmark.tags.join(", "); } else { if (buffer.title != buffer.URL) - title = " -title=" + quote(buffer.title); + options["-title"] = buffer.title; } - commandline.open(":", "bmark " + buffer.URL + title + keyword + tags, modes.EX); + commandline.open(":", + commands.commandToString({ command: "bmark", options: options, arguments: [buffer.URL], bang: bmarks.length == 1 }), + modes.EX); }); mappings.add(myModes, ["A"], diff --git a/common/content/browser.js b/common/content/browser.js old mode 100755 new mode 100644 diff --git a/common/content/commands.js b/common/content/commands.js old mode 100755 new mode 100644 index 7b55e808..48be9206 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -506,13 +506,14 @@ function Commands() //{{{ commandToString: function (args) { let res = [args.command + (args.bang ? "!" : "")]; - function quote(str) quoteArg[/\s/.test(str) ? '"' : ""](str); + function quote(str) quoteArg[/[\s"'\\]|^$/.test(str) ? '"' : ""](str); for (let [opt, val] in Iterator(args.options || {})) { - res.push(opt); + let char = /^-.$/.test(opt) ? " " : "="; if (val != null) - res.push(quote(val)); + opt += char + quote(val) + res.push(opt); } for (let [,arg] in Iterator(args.arguments || [])) res.push(quote(arg)); diff --git a/common/content/completion.js b/common/content/completion.js old mode 100755 new mode 100644 diff --git a/common/content/events.js b/common/content/events.js old mode 100755 new mode 100644 diff --git a/common/content/hints.js b/common/content/hints.js old mode 100755 new mode 100644 diff --git a/common/content/io.js b/common/content/io.js old mode 100755 new mode 100644 diff --git a/common/content/liberator.js b/common/content/liberator.js old mode 100755 new mode 100644 diff --git a/common/content/mappings.js b/common/content/mappings.js old mode 100755 new mode 100644 diff --git a/common/content/modes.js b/common/content/modes.js old mode 100755 new mode 100644 diff --git a/common/content/options.js b/common/content/options.js old mode 100755 new mode 100644 diff --git a/common/content/style.js b/common/content/style.js old mode 100755 new mode 100644 diff --git a/common/content/ui.js b/common/content/ui.js old mode 100755 new mode 100644 diff --git a/common/content/util.js b/common/content/util.js old mode 100755 new mode 100644 diff --git a/xulmus/content/player.js b/xulmus/content/player.js old mode 100755 new mode 100644