From 46ad5e61e0464ff12af74b24316cfc94c61150ce Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 24 Jul 2002 00:42:12 +0000 Subject: [PATCH] wallpaper for a bit of bug 120327; this should keep us from appending ".exe" all the time to things on Windows. patch by me and jruderman@hmc.edu, r=law, sr=jag, a=asa --- uriloader/exthandler/nsExternalHelperAppService.cpp | 13 +++++++++++++ uriloader/exthandler/win/nsOSHelperAppService.cpp | 12 ++++++++++++ 2 files changed, 25 insertions(+) diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index 00a39596c3d..bda5a31dc48 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -275,7 +275,20 @@ NS_IMETHODIMP nsExternalHelperAppService::DoContent(const char *aMimeContentType // (2) if we don't have a match yet, see if this type is in our list of extras. if (!mimeInfo) { +#ifdef XP_WIN + /* XXX Gross hack to wallpaper over the most common Win32 + * extension issues caused by the fix for bug 116938. See bug + * 120327, comment 271 for why this is needed. Not even sure we + * want to remove this once we have fixed all this stuff to work + * right; any info we get from extras on this type is pretty much + * useless.... + */ + if (PL_strcasecmp(aMimeContentType, APPLICATION_OCTET_STREAM) != 0) { +#endif GetMIMEInfoForMimeTypeFromExtras(aMimeContentType, getter_AddRefs(mimeInfo)); +#ifdef XP_WIN + } +#endif } // (3) if we STILL don't have a mime object for this content type then give up diff --git a/uriloader/exthandler/win/nsOSHelperAppService.cpp b/uriloader/exthandler/win/nsOSHelperAppService.cpp index 26e28903bf0..bda4c7d8b1e 100644 --- a/uriloader/exthandler/win/nsOSHelperAppService.cpp +++ b/uriloader/exthandler/win/nsOSHelperAppService.cpp @@ -29,6 +29,7 @@ #include "nsMimeTypes.h" #include "nsILocalFile.h" #include "nsIProcess.h" +#include "plstr.h" // we need windows.h to read out registry information... #include @@ -374,6 +375,17 @@ NS_IMETHODIMP nsOSHelperAppService::GetFromMIMEType(const char *aMIMEType, nsIMI nsresult rv = nsExternalHelperAppService::GetFromMIMEType(aMIMEType, _retval); if (NS_SUCCEEDED(rv) && *_retval) return NS_OK; // okay we got an entry so we are done. + if (PL_strcasecmp(aMIMEType, APPLICATION_OCTET_STREAM) == 0) { + /* XXX Gross hack to wallpaper over the most common Win32 + * extension issues caused by the fix for bug 116938. See bug + * 120327, comment 271 for why this is needed. Not even sure we + * want to remove this once we have fixed all this stuff to work + * right; any info we get from the OS on this type is pretty much + * useless.... + */ + return NS_ERROR_FAILURE; + } + // (1) try to use the windows mime database to see if there is a mapping to a file extension // (2) try to see if we have some left over 4.x registry info we can peek at... nsCAutoString fileExtension;