Implement the equivalent of Unix's realpath() for BeOS. Build blocker. a=leaf
git-svn-id: svn://10.0.0.236/trunk@61548 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -36,6 +36,9 @@
|
||||
#include <utime.h>
|
||||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
#ifdef XP_BEOS
|
||||
#include <Path.h>
|
||||
#endif
|
||||
|
||||
#include "nsCRT.h"
|
||||
#include "nsCOMPtr.h"
|
||||
@@ -410,7 +413,16 @@ nsLocalFile::Normalize()
|
||||
char resolved_path[PATH_MAX];
|
||||
char *resolved_path_ptr = NULL;
|
||||
CHECK_mPath();
|
||||
#ifdef XP_BEOS
|
||||
BEntry be_e((const char*)mPath, true);
|
||||
BPath be_p;
|
||||
status_t err;
|
||||
if ((err = be_e.GetPath(&be_p)) == B_OK) {
|
||||
resolved_path_ptr = be_p.Path();
|
||||
};
|
||||
#else
|
||||
resolved_path_ptr = realpath(mPath, resolved_path);
|
||||
#endif
|
||||
// if there is an error, the return is null.
|
||||
if (resolved_path_ptr == NULL) {
|
||||
return NSRESULT_FOR_ERRNO();
|
||||
|
||||
Reference in New Issue
Block a user