1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-14 17:45:45 +01:00

Fix some unnecessary error reports for invalid jar: URLs. Also complete the JAR file portion of the URL.

This commit is contained in:
Kris Maglione
2011-03-10 10:58:02 -05:00
parent d7b68c66af
commit b7a3f8d2fb
3 changed files with 15 additions and 4 deletions

View File

@@ -354,7 +354,7 @@ var IO = Module("io", {
*/
listJar: function listJar(file, path) {
file = util.getFile(file);
if (file) {
if (file && file.exists() && file.isFile() && file.isReadable()) {
// let jar = services.zipReader.getZip(file); Crashes.
let jar = services.ZipReader(file);
try {
@@ -366,7 +366,8 @@ var IO = Module("io", {
yield entry;
}
finally {
jar.close();
if (jar)
jar.close();
}
}
},
@@ -878,6 +879,9 @@ unlet s:cpo_save
};
completion.file = function file(context, full, dir) {
if (/^jar:[^!]*$/.test(context.filter))
context.advance(4);
// dir == "" is expanded inside readDirectory to the current dir
function getDir(str) str.match(/^(?:.*[\/\\])?/)[0];
dir = getDir(dir || context.filter);