Closed
Bug 745466
Opened 12 years ago
Closed 12 years ago
initWithPath fails for "~"
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
mozilla14
People
(Reporter: asaf, Assigned: asaf)
Details
Attachments
(1 file)
2.03 KB,
patch
|
bzbarsky
:
review+
benjamin
:
superreview+
|
Details | Diff | Splinter Review |
initWithPath("~/Downloads") - works. initWithPath("~/Downloads/") - works. initWithPath("~/") - works. initWithPath("~") - does not work.
Assignee | ||
Comment 1•12 years ago
|
||
Assignee: nobody → mano
Status: NEW → ASSIGNED
Attachment #615066 -
Flags: superreview?(bzbarsky)
Attachment #615066 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 2•12 years ago
|
||
This is necessary for bug 710259 (for importing the Downloads folder if it's set to the user's home folder).
Comment 3•12 years ago
|
||
Comment on attachment 615066 [details] [diff] [review] patch + test r=me, but this needs a separate sr
Attachment #615066 -
Flags: superreview?(bzbarsky)
Attachment #615066 -
Flags: superreview?(benjamin)
Attachment #615066 -
Flags: review?(bzbarsky)
Attachment #615066 -
Flags: review+
Assignee | ||
Comment 4•12 years ago
|
||
Comment on attachment 615066 [details] [diff] [review] patch + test Thanks Boris. >- if (Substring(filePath, 0, 2).EqualsLiteral("~/")) { >+ if (filePath.Equals("~") || Substring(filePath, 0, 2).EqualsLiteral("~/")) { > nsCOMPtr<nsIFile> homeDir; > nsCAutoString homePath; > if (NS_FAILED(NS_GetSpecialDirectory(NS_OS_HOME_DIR, > getter_AddRefs(homeDir))) || > NS_FAILED(homeDir->GetNativePath(homePath))) { > return NS_ERROR_FAILURE; > } >- >- mPath = homePath + Substring(filePath, 1, filePath.Length() - 1); >+ >+ mPath = homePath; >+ if (filePath.Length() > 1) >+ mPath.Append(Substring(filePath, 1, filePath.Length() - 1)); > } else { That shoukd have been > 2 (or could have been, it does not hurt as it is now).
Updated•12 years ago
|
Attachment #615066 -
Flags: superreview?(benjamin) → superreview+
Assignee | ||
Comment 5•12 years ago
|
||
http://hg.mozilla.org/integration/mozilla-inbound/rev/0d48714f4773
Target Milestone: --- → mozilla14
Comment 6•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/0d48714f4773
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 7•12 years ago
|
||
and the follow-up https://hg.mozilla.org/mozilla-central/rev/296b90f063d5
You need to log in
before you can comment on or make changes to this bug.
Description
•