Closed
Bug 151843
Opened 23 years ago
Closed 23 years ago
nsIFile::Append inconsistent across platforms [was: nsiFile append behaviour changed for empty string]
Categories
(Core :: Networking: HTTP, defect, P4)
Tracking
()
VERIFIED
FIXED
mozilla1.2alpha
People
(Reporter: pwilson, Assigned: darin.moz)
Details
Attachments
(1 file)
|
2.26 KB,
patch
|
dougt
:
review+
alecf
:
superreview+
|
Details | Diff | Splinter Review |
The behaviour of the nsIFile (possibly nsILocalFile) append method has changed
w.r.t. to the empty string.
It used to be possible to do:
Win2000 build: 2002061104
aFile.append("")
This would take a path and ensure that it terminated with the correct directory
separator for the OS. eg File("c:\temp").append("") would yield c:\temp\ on
Windows. Appropriate behaviour on Unix would be to use the "/" character.
This call now throws an exception. This forces the programmer to discover which
OS they are running under and then append the appropriate separator.
Comment 1•23 years ago
|
||
Do you use embedding ?
| Reporter | ||
Comment 2•23 years ago
|
||
Not embedding, just regular Mozilla.
Comment 3•23 years ago
|
||
-> Darin: do you own nsiFile ?
Assignee: Matti → darin
Component: Browser-General → Networking: HTTP
QA Contact: imajes-qa → tever
| Assignee | ||
Comment 4•23 years ago
|
||
hmm... why do you need this behavior? i think the original behavior was an
unintended side-effect, but i could be wrong about that... cc'ing some other
nsIFile folks.
| Reporter | ||
Comment 5•23 years ago
|
||
Don't sweat it - I've already worked around the problem.
| Assignee | ||
Comment 6•23 years ago
|
||
resolving WONTFIX .. unless someone can correct my assumptions about the meaning
of the API.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → WONTFIX
Comment 7•23 years ago
|
||
can we document this somewhere, like in nsIFile.idl, something to the effect of
"unles specified otherwise, null or empty strings are not valid parameters in
this interface, and an exception will be thrown"
| Assignee | ||
Comment 8•23 years ago
|
||
ah, there is a difference between the XP_WIN and XP_UNIX impls. the XP_UNIX
impl just returns NS_OK on AppendNative(""), whereas the XP_WIN version throws
an exception! we need to unify these. i think the XP_UNIX behavior makes the
most sense.
reopening
Status: RESOLVED → UNCONFIRMED
Resolution: WONTFIX → ---
| Assignee | ||
Updated•23 years ago
|
Severity: normal → minor
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P4
Target Milestone: --- → mozilla1.1beta
| Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla1.1beta → mozilla1.2alpha
| Assignee | ||
Comment 9•23 years ago
|
||
this patch touches up the impl of AppendNative for XP_WIN, XP_MAC, and XP_OS2.
with this patch, AppendNative now does an early return of NS_OK if the input is
an empty string. this seems reasonable, and it shouldn't impact any of the
callers since they would otherwise already have a XP_UNIX bug.
| Assignee | ||
Updated•23 years ago
|
Keywords: mozilla1.2,
patch
Summary: nsiFile append behaviour changed for empty string → nsIFile::Append inconsistent across platforms [was: nsiFile append behaviour changed for empty string]
Updated•23 years ago
|
Attachment #97490 -
Flags: review+
Comment 10•23 years ago
|
||
Comment on attachment 97490 [details] [diff] [review]
v1 patch
r=dougt
Comment 11•23 years ago
|
||
Comment on attachment 97490 [details] [diff] [review]
v1 patch
sr=alecf
Attachment #97490 -
Flags: superreview+
| Assignee | ||
Comment 12•23 years ago
|
||
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago → 23 years ago
Resolution: --- → FIXED
Comment 13•23 years ago
|
||
verified - checked with Lxr that patch was applied
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•