From 7404fbfb83dfcb2c8c3502e0e072c33bbc8508d7 Mon Sep 17 00:00:00 2001 From: "gagan%netscape.com" Date: Fri, 30 Jul 1999 01:17:29 +0000 Subject: [PATCH] Fixes the spaces problem also on the Mac! --- netwerk/protocol/file/src/nsFileChannel.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/netwerk/protocol/file/src/nsFileChannel.cpp b/netwerk/protocol/file/src/nsFileChannel.cpp index 169dabf93320..5b8883f3767a 100644 --- a/netwerk/protocol/file/src/nsFileChannel.cpp +++ b/netwerk/protocol/file/src/nsFileChannel.cpp @@ -105,7 +105,7 @@ nsFileChannel::Init(nsFileProtocolHandler* handler, nsSpecialSystemDirectory netscapeDir(nsSpecialSystemDirectory::OS_CurrentProcessDirectory); mSpec = netscapeDir + (fileString + kNetscapeDirectoryLength); } else { - nsFilePath filePath(fileString); + nsFilePath filePath(nsUnescape((char*)(const char*)fileString)); mSpec = filePath; // Don't assume we actually created a good file spec @@ -114,14 +114,8 @@ nsFileChannel::Init(nsFileProtocolHandler* handler, { NS_ERROR("failed to create a file spec"); - // Some temp debugstr hackery so optimized builds display an error message - // !!!!!REMOVE THIS ONCE WE GET THE FILE NAME UN-ESCAPING CODE IN - DebugStr("\p\rFailed to create a file spec for the specified file.\r"\ - "This is usually due to having a space somewhere in the path\r"\ - "to the application (say if your hard drive is named Macintosh HD\r"\ - "or you're trying to run from the Desktop Folder). We'll fix this soon."); - - // Since we didn't actually create the file spec we return an error + // Since we didn't actually create the file spec + // we return an error return NS_ERROR_MALFORMED_URI; } }