Closed Bug 84738 Opened 23 years ago Closed 23 years ago

leafName returns a wrong string [PATCH]

Categories

(Core :: XPCOM, defect, P3)

Other
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla0.9.3

People

(Reporter: pete, Assigned: pete)

Details

Attachments

(6 files)

leafName returns a wrong string after manipulation
from parent.

Output of Test:

js> o;
[xpconnect wrapped nsIFile @ 0x80972c8]
js> o.path;
/tmp
js> o.leafName;
tmp
js> o.path;
/tmp
js> o.parent.path;
/
js> o.leafName;
mp
js> o.path;
//mp
js>

You can assign this to me if you want and i'll take a look at it.

--pete
Does not appear to be an XPCOM problem to me from the discription.  Reassigning
as reuqested.  Thanks.
Assignee: kandrot → petejc
kandrot: Last I checked the implementations of nsIFile were in xpcom.
Attached patch patchSplinter Review
OK, This patch fixes the problem

--pete
Keywords: patch, review
Summary: leafName returns a wrong string after manipulating the parent → leafName returns a wrong string [PATCH]
Setting Target to 0.9.3

--pete
Target Milestone: --- → mozilla0.9.3
Priority: -- → P3
Severity: normal → major
Test output after fix:


js> o;
[xpconnect wrapped nsIFile @ 0x814b678]
js> o.path;
/tmp
js> o.parent.path;
/
js> o.path;
/tmp
js> o.parent.path;
/
js> r;
[xpconnect wrapped nsIFile @ 0x814bcb0]
js> r.path;
/
js> r.parent.path;
/
js> r.path;
/
js> 
Status: NEW → ASSIGNED
Where is |orig| freed?

nits:

Why did the whitespace change on @@ -929,7 +930,7 @@

Use PRBool instead of bool.

Even though I uses curly braces like you, the heathen owners don't:       

if (slashp == buffer)
-        slashp++;
+    {

Zap that space between the "if" and "else":
+
+    if(root)
+      mPath.Adopt(orig);
+
+    else
Where is |orig| freed?

See path  #39511. . .

nits:

> Why did the whitespace change on @@ -929,7 +930,7 @@

This is a rsult of previous tabs that someone checked in. 

> Use PRBool instead of bool.

Yes, forgot. It in now.

> Even though I uses curly braces like you, the heathen owners don't:       

if (slashp == buffer)
-        slashp++;
+    {


The curly braces are to accomondate the assignment of `root=PR_TRUE'
I don't use curly braces for one liners either . . .  ;-)

> Zap that space between the "if" and "else":

Zapped  . . . 

--pete

nit: 
if thou brace "else", thou must not forsaken "if".  
spacing problem still is there (but I am not one to talk).

Fix that and r=dougt
Attached patch minor ws tweakSplinter Review
Looks good to me, but please change the brace style in the changes to match
what's done in the rest of thise file, i.e.:

    if (...) {
        ..
    }

and not:

    if (...)
    {
        ...
    }

and also use 4-space indentation, just like the other code in that file does.
Consistency with surrounding code overways correctness when it comes to
whitespace useage since there is no correct way! :-)

With that fixed, sr=jst
s/overways/overweighs/
I checked this in this morning

resolving fixed

--pete
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: