r=mkaply, sr=blizzard (platform specific), a=mkaply (OS/2 only)
Patch from Andy Willis for XUL Runner - convert a Unix path to platform path
This commit is contained in:
mkaply%us.ibm.com 2005-04-22 13:49:03 +00:00
parent e56ecb6807
commit 2431a71167

View File

@ -795,7 +795,7 @@ XRE_GetFileFromPath(const char *aPath, nsILocalFile* *aResult)
CFRelease(fullPath);
return rv;
#elif defined(XP_UNIX) || defined(XP_OS2)
#elif defined(XP_UNIX)
char fullPath[MAXPATHLEN];
if (!realpath(aPath, fullPath))
@ -803,6 +803,18 @@ XRE_GetFileFromPath(const char *aPath, nsILocalFile* *aResult)
return NS_NewNativeLocalFile(nsDependentCString(fullPath), PR_TRUE,
aResult);
#elif defined(XP_OS2)
char fullPath[MAXPATHLEN];
if (!realpath(aPath, fullPath))
return NS_ERROR_FAILURE;
// realpath on OS/2 returns a unix-ized path, so re-native-ize
for (char* ptr = strchr(fullPath, '/'); ptr; ptr = strchr(ptr, '/'))
*ptr = '\\';
return NS_NewNativeLocalFile(nsDependentCString(fullPath), PR_TRUE,
aResult);
#elif defined(XP_WIN)
char fullPath[MAXPATHLEN];