mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
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:
parent
e56ecb6807
commit
2431a71167
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user