diff --git a/common/content/commands.js b/common/content/commands.js index 24eeaedc..f21cb53e 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -1001,7 +1001,7 @@ const Commands = Module("commands", { var context = complete.fork("args", len); } - if (!complete || /\w[!\s]/.test(str)) + if (!complete || /(\w|^)[!\s]/.test(str)) args = command.parseArgs(args, context, { count: count, bang: bang }); else args = commands.parseArgs(args, { extra: { count: count, bang: bang } }); diff --git a/common/modules/storage.jsm b/common/modules/storage.jsm index 266336e9..213e7788 100644 --- a/common/modules/storage.jsm +++ b/common/modules/storage.jsm @@ -282,7 +282,7 @@ const File = Class("File", { } catch (e) { util.reportError(e); - return null; + return File.DoesNotExist(e); } } let self = XPCSafeJSObjectWrapper(file); @@ -489,6 +489,11 @@ const File = Class("File", { return this.PATH_SEP = f.path.substr(f.parent.path.length, 1); }, + DoesNotExist: function (error) ({ + exists: function () false, + __noSuchMethod__: function () { throw error || Error("Does not exist"); } + }), + defaultEncoding: "UTF-8", expandPath: function (path, relative) { @@ -543,7 +548,7 @@ const File = Class("File", { path.appendRelativePath(this.expandPath(tail, true)); } catch (e) { - return { exists: function () false, __noSuchMethod__: function () { throw e; } }; + return File.DoesNotExist(e); } return path; },