nsLocalFileMac::GetParent doesn't return null at top of volume

RESOLVED WONTFIX

Status

()

Core
XPCOM
--
minor
RESOLVED WONTFIX
16 years ago
15 years ago

People

(Reporter: bbaetz, Assigned: Conrad Carlen (not reading bugmail))

Tracking

Trunk
mozilla1.0.1
PowerPC
Mac System 9.x
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

16 years ago
The nsIFile docs say:

    /**
     * Parent will be null when this is at the top of the volume.
     */
    readonly attribute nsIFile parent;

mac doesn't do this (it returns a failure code instead), and this caused
failures for me when adding a "go to parent directory" link for the html file
viewer. Windows doesn't either, but darin has a patch for this.

I've worked arround this by not returning on failure from calls to GetPArent,
and just not displaying the link if we fail, so this doesn't block me for
anything, its just a correctness fix.

unix does handle this correctly.

peterv suggested that ccarlen gets these sort of bugs.
(Assignee)

Comment 1

16 years ago
I think the Unix impl, if it returns null for the parent and NS_OK, is in the
wrong (as are the idl comments). If the file in fact has no parent, asking for
its parent would seem like a good time to return an error. If darin has a patch
for this for Windows, maybe this has been debated already. Please fill me in.
(Reporter)

Comment 2

16 years ago
Well, there is a differnece between "I have no parent" and "I hav eno clue what
my parent is, because someone pulled the floppy disk out of the drive"

Its not an error to not have a parent.

Comment 3

16 years ago
i agree w/ bradley.  it isn't an exception to not have a parent!  think about js
code.  it shouldn't have to wrap every call to GetParent with a try/catch block
just to determine if there is or isn't a parent.  returning NULL makes sense.
(Assignee)

Comment 4

16 years ago
Alright - put that way, you're right. Easy to fix.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0.1

Updated

15 years ago
Hardware: PC → Macintosh
(Assignee)

Comment 5

15 years ago
This is specific to the old Mac file impl, which is dead. The new impl, in
nsLocalFileOSX, does the right thing here.
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.