Closed
Bug 97679
Opened 23 years ago
Closed 23 years ago
nsIOService::ExtractUrlPart fails to return filename or extension parts
Categories
(Core :: Networking, defect)
Tracking
()
VERIFIED
FIXED
mozilla0.9.4
People
(Reporter: cmanske, Assigned: dougt)
References
Details
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
Maybe this should go to Networking: File component?
If you use nsIOServices.url_FileBaseName or url_FileExtension to extract the
filename or extension from a url, it returns empty strings.
The problem is obvious, in the line:
rv = parser->ParseAtDirectory(path,
getter_Copies(path),
getter_Copies(fileBaseName),
getter_Copies(fileExtension),
getter_Copies(param),
getter_Copies(query),
getter_Copies(ref));
you can't use "path" as both an in parameter and and out parameter;
"getter_Copies" will null out the "path" and ParseAtDirectory can't find
the filename.
Reporter | ||
Comment 1•23 years ago
|
||
Reporter | ||
Comment 2•23 years ago
|
||
Work I'm doing in Composer for the 0.9.4 milestone and would like to use
nsIOService::ExtractUrlPart() to get a filename.
We obviously can find it ourselves, but we are trying
to use nsIOService and nsIURI interfaces as much as possible.
This problem seems very understandable and easy to fix, so can we also fix it for
0.9.4?
Assigning to Doug T, as it looks like he's a major contributor in this file.
Assignee | ||
Comment 3•23 years ago
|
||
r=dougt... it looks good. Darin, can I get a sr=?
Comment 4•23 years ago
|
||
sr=darin
Assignee | ||
Comment 5•23 years ago
|
||
Charles, you can try for a= and get this in right away, or I can check it in
after the trunk opens.
Comment 6•23 years ago
|
||
sr=blizzard on behalf of drivers for 0.9.4
Comment 7•23 years ago
|
||
That's not all, the code part that gets start and end positions always gets
called with FileBaseName in the path-part.
Second: the url_directory mask is missused to get the whole path. There should
be an additional mask to get the whole path or the code should be able to use
multiple masks in one request.
A new mask would be possible if bug 94796 is fixed which would free the
url-masks from nsURLEscape usage.
Reporter | ||
Comment 8•23 years ago
|
||
Andreas: I'm not sure I get everything you say above, but is it ok to checkin
my part of the fix, right?
With it, getting fileBaseName and fileExtension do seem to work correctly.
Do you want to keep this bug open or file another for the issues you mentioned?
Comment 9•23 years ago
|
||
Reporter | ||
Comment 10•23 years ago
|
||
Checked in.
Andreas and Darin: There's at least one other problem in this file,
so I cc'd you guys in bug 97682
Comment 11•23 years ago
|
||
+verifyme - If there is a black box set of steps, Tom or I can verify.
This looks like it was fixed pre-branch. Please comment if I was wrong.
Charles:
does this function call work correctly for you now?
If so, can you mark VERIFY this bug as a code change?
Keywords: verifyme
Reporter | ||
Comment 12•23 years ago
|
||
Yep, works great now! The fix for Composer bug 72583 excersizes this code.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•