From 09a4c0e15bba83e0914e3c1b54966e56d23ea8c8 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Sun, 20 Jan 2008 23:34:00 +0000 Subject: [PATCH] do not load .swp or other files in macro directory --- content/events.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/content/events.js b/content/events.js index 5ee99f97..0ecc1a81 100644 --- a/content/events.js +++ b/content/events.js @@ -444,8 +444,9 @@ vimperator.Events = function () //{{{ for (var i = 0; i < files.length; i++) { var file = files[i]; - if (!file.exists() || file.isDirectory() || !file.isReadable()) - continue; + if (!file.exists() || file.isDirectory() || + !file.isReadable() || !/^[\w_-]+(\.vimp)?$/i.test(file.leafName)) + continue; var name = file.leafName.replace(/\.vimp$/i, ""); macros[name] = vimperator.io.readFile(file).split(/\n/)[0]; @@ -1163,7 +1164,6 @@ vimperator.Events = function () //{{{ // only thrown for the current tab, not when another tab changes if (flags & Components.interfaces.nsIWebProgressListener.STATE_START) { - dump("start\n"); vimperator.buffer.loaded = 0; vimperator.statusline.updateProgress(0); setTimeout (function () { vimperator.modes.reset(false); }, @@ -1171,7 +1171,6 @@ vimperator.Events = function () //{{{ } else if (flags & Components.interfaces.nsIWebProgressListener.STATE_STOP) { - dump("stop\n"); vimperator.buffer.loaded = (status == 0 ? 1 : 2); vimperator.statusline.updateUrl(); }