Closed Bug 97679 Opened 23 years ago Closed 23 years ago

nsIOService::ExtractUrlPart fails to return filename or extension parts

Categories

(Core :: Networking, defect)

x86
Windows NT
defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla0.9.4

People

(Reporter: cmanske, Assigned: dougt)

References

Details

Attachments

(1 file)

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.
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: neeti → dougt
Blocks: 72583
Severity: normal → major
Keywords: patch, review
Target Milestone: --- → mozilla0.9.4
r=dougt... it looks good. Darin, can I get a sr=?
sr=darin
Charles, you can try for a= and get this in right away, or I can check it in after the trunk opens.
sr=blizzard on behalf of drivers for 0.9.4
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.
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?
Go ahead, I will file a new bug. I saw the issues while investigating bug 47437. I will get back to ExtractUrlPart once bug 94796 is done.
Checked in. Andreas and Darin: There's at least one other problem in this file, so I cc'd you guys in bug 97682
Status: NEW → RESOLVED
Closed: 23 years ago
Keywords: patch, review
Resolution: --- → FIXED
+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
Yep, works great now! The fix for Composer bug 72583 excersizes this code.
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: