Bug 398551 - Cannot download tar.gz or tar.bz2 files from the "Open with" dialog. r=gavin.sharp, b-ff3=beltzner, a=b-ff3 M9

git-svn-id: svn://10.0.0.236/trunk@237963 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edward.lee%engineering.uiuc.edu 2007-10-20 21:09:40 +00:00
parent 09777fb442
commit 3112a93685

View File

@ -257,17 +257,25 @@ nsUnknownContentTypeDialog.prototype = {
this.makeFileUnique(aLocalFile);
#ifdef XP_WIN
let ext;
try {
// We can fail here if there's no primary extension set
ext = "." + this.mLauncher.MIMEInfo.primaryExtension;
} catch (e) { }
// Append a file extension if it's an executable that doesn't have one
let ext = "." + this.mLauncher.MIMEInfo.primaryExtension;
// but make sure we actually have an extension to add
let leaf = aLocalFile.leafName;
if (aLocalFile.isExecutable() &&
if (aLocalFile.isExecutable() && ext &&
leaf.substring(leaf.length - ext.length) != ext) {
var f = aLocalFile.clone();
let f = aLocalFile.clone();
aLocalFile.leafName = leaf + ext;
f.remove(false);
this.makeFileUnique(aLocalFile);
}
#endif
return aLocalFile;
},