From e32642f68ec20a267002648f335b0ca7c94dd4c3 Mon Sep 17 00:00:00 2001 From: "paul@chromium.org" Date: Fri, 11 Sep 2009 21:58:29 +0000 Subject: Fix two issues with a downloaded file's extension: 1. On Mac, we were prepending an extra '.' to the extension causing it to fail a comparison (resulting in second extension being added). 2. For downloads with the extension '.tgz' and mime type 'application/x-gzip', we were appending an extra '.gz' extension. The extension compare code is starting to get a little long, but I don't think it's too bad if there are only a few of these cases. BUG=21591,21595 TEST=1. Download a file on Mac with a well known extension type (mp3, gz) and notice that there are no double extensions. 2. Download a tgz file and notice that the file's extension is '.tgz', not '.tgz.gz'. Review URL: http://codereview.chromium.org/195064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26028 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/platform_mime_util_mac.cc | 5 ----- 1 file changed, 5 deletions(-) (limited to 'net/base') diff --git a/net/base/platform_mime_util_mac.cc b/net/base/platform_mime_util_mac.cc index bf1cdee..ce8c336 100644 --- a/net/base/platform_mime_util_mac.cc +++ b/net/base/platform_mime_util_mac.cc @@ -50,11 +50,6 @@ bool PlatformMimeUtil::GetPreferredExtensionForMimeType( if (!ext_ref) return false; - ext_ref.reset(CFStringCreateWithFormat(kCFAllocatorDefault, - NULL, - CFSTR(".%@"), - ext_ref.get())); - *ext = base::SysCFStringRefToUTF8(ext_ref); return true; } -- cgit v1.1