Bug 396477 - DM renames many files with double extension, e.g. filename.exe.exe. r=sdwilsh, a=mconnor

This commit is contained in:
edward.lee@engineering.uiuc.edu 2007-10-02 08:10:39 -07:00
Родитель 4281d2a7c8
Коммит 743fea8d4a
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -256,9 +256,13 @@ nsUnknownContentTypeDialog.prototype = {
this.makeFileUnique(aLocalFile);
if (aLocalFile.isExecutable() && !this.mLauncher.targetFile.isExecutable()) {
// Append a file extension if it's an executable that doesn't have one
let ext = "." + this.mLauncher.MIMEInfo.primaryExtension;
let leaf = aLocalFile.leafName;
if (aLocalFile.isExecutable() &&
leaf.substring(leaf.length - ext.length) != ext) {
var f = aLocalFile.clone();
aLocalFile.leafName = aLocalFile.leafName + "." + this.mLauncher.MIMEInfo.primaryExtension;
aLocalFile.leafName = leaf + ext;
f.remove(false);
this.makeFileUnique(aLocalFile);