From 2c3de63a1451ea43934e9b62219ffa8be64a8aee Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Mon, 17 Dec 2007 21:48:09 -0800 Subject: [PATCH] Bug 160454 - "Eliminate use of HEAD in "save as"" ((AAv1) cleanup |getFileBaseName()| usages) [p=sgautherie.bz@free.fr (Serge Gautherie) r=Mano sr=Neil a1.9=beltzner] --- toolkit/content/contentAreaUtils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toolkit/content/contentAreaUtils.js b/toolkit/content/contentAreaUtils.js index 78094e6f90c3..d5c8e799d1f6 100644 --- a/toolkit/content/contentAreaUtils.js +++ b/toolkit/content/contentAreaUtils.js @@ -337,7 +337,7 @@ function internalSave(aURL, aDocument, aDefaultFileName, aContentDisposition, // Create the local directory into which to save associated files. filesFolder = file.clone(); - var nameWithoutExtension = filesFolder.leafName.replace(/\.[^.]*$/, ""); + var nameWithoutExtension = getFileBaseName(filesFolder.leafName); var filesFolderLeafName = getStringBundle().formatStringFromName("filesFolder", [nameWithoutExtension], 1); @@ -441,7 +441,7 @@ function initFileInfo(aFI, aURL, aURLCharset, aDocument, aFI.fileBaseName = aFI.fileName; } else { aFI.fileExt = getDefaultExtension(aFI.fileName, aFI.uri, aContentType); - aFI.fileBaseName = getFileBaseName(aFI.fileName, aFI.fileExt); + aFI.fileBaseName = getFileBaseName(aFI.fileName); } } catch (e) { } @@ -710,7 +710,7 @@ function getMIMEService() } // Given aFileName, find the fileName without the extension on the end. -function getFileBaseName(aFileName, aFileExt) +function getFileBaseName(aFileName) { // Remove the file extension from aFileName: return aFileName.replace(/\.[^.]*$/, "");