Closed
Bug 367608
Opened 18 years ago
Closed 18 years ago
implement nsIFile::normalize() on OS X
Categories
(Core :: XPCOM, enhancement)
Tracking
()
RESOLVED
FIXED
People
(Reporter: sayrer, Assigned: sayrer)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
benjamin
:
superreview+
|
Details | Diff | Splinter Review |
Assignee | ||
Comment 1•18 years ago
|
||
Attachment #252175 -
Flags: review?(mano)
Updated•18 years ago
|
Assignee: sayrer → nobody
Component: File Handling → XPCOM
QA Contact: ian → xpcom
Updated•18 years ago
|
Assignee: nobody → sayrer
Comment 2•18 years ago
|
||
Comment on attachment 252175 [details] [diff] [review]
implement normalize
>Index: nsLocalFileOSX.cpp
>===================================================================
>+ PRBool success;
>+ success = ::CFURLGetFileSystemRepresentation(mBaseRef, true, path, PATH_MAX);
nit: use BOOL here.
>+ if (!success)
>+ return NS_ERROR_FAILURE;
>+
>+ char resolved_path[PATH_MAX] = "";
>+ char *resolved_path_ptr = nsnull;
>+ resolved_path_ptr = realpath((char*)path, resolved_path);
>+
>+ // if there is an error, the return is null.
>+ if (!resolved_path_ptr)
>+ return NS_ERROR_FAILURE;
>+
>+ // Need to know whether we're a directory to create a new CFURLRef
>+ PRBool isDirectory;
>+ nsresult rv = IsDirectory(&isDirectory);
>+ if (NS_FAILED(rv))
>+ return rv;
>+
nit: use NS_ENSURE_SUCCESS.
r=mano otherwise.
Attachment #252175 -
Flags: review?(mano) → review+
Assignee | ||
Comment 3•18 years ago
|
||
re: nit 1, I used Boolean, not BOOL.
I also changed the result code if realpath fails, to emulate the unix version.
Attachment #252175 -
Attachment is obsolete: true
Assignee | ||
Comment 4•18 years ago
|
||
Attachment #252635 -
Flags: superreview?(benjamin)
Updated•18 years ago
|
Attachment #252632 -
Attachment is obsolete: true
Updated•18 years ago
|
Attachment #252635 -
Flags: superreview?(benjamin) → superreview+
Assignee | ||
Comment 5•18 years ago
|
||
Checking in io/nsLocalFileOSX.cpp;
/cvsroot/mozilla/xpcom/io/nsLocalFileOSX.cpp,v <-- nsLocalFileOSX.cpp
new revision: 1.48; previous revision: 1.47
done
Checking in tests/nsIFileTest.cpp;
/cvsroot/mozilla/xpcom/tests/nsIFileTest.cpp,v <-- nsIFileTest.cpp
new revision: 1.32; previous revision: 1.31
done
Status: NEW → RESOLVED
Closed: 18 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•