Closed
Bug 11726
Opened 25 years ago
Closed 25 years ago
ReplaceDotMess errors when backslashes are in an URL.
Categories
(Core :: Networking, defect, P3)
Core
Networking
Tracking
()
VERIFIED
FIXED
People
(Reporter: bratell, Assigned: gagan)
Details
(Whiteboard: [PATCH] asked reporter)
Attachments
(1 file)
1.14 KB,
patch
|
Details | Diff | Splinter Review |
Overview Description: If slash and backslash should be treated the same in a path as suggested by the fix to bug 8573, then there are a few trivial errors in functionality in |nsStdUrl|s ReplaceDotMess function where the lookahead doesn't take backslashes into account. Because it's a look ahead the backslashes are still there since they're not converted yet. Patch to fix (against nsStdURL.cpp v1.11): Index: nsStdURL.cpp =================================================================== RCS file: /cvsroot/mozilla/netwerk/base/src/nsStdURL.cpp,v retrieving revision 1.11 diff -u -r1.11 nsStdURL.cpp --- nsStdURL.cpp 1999/08/12 09:59:24 1.11 +++ nsStdURL.cpp 1999/08/12 12:17:47 @@ -933,15 +933,19 @@ for(; *fwdPtr != '\0'; ++fwdPtr) { + // Replace \ with / if (*fwdPtr == '\\') *fwdPtr = '/'; - if (*fwdPtr == '/' && *(fwdPtr+1) == '.' && *(fwdPtr+2) == '/') + + if (*fwdPtr == '/' && *(fwdPtr+1) == '.' && + (*(fwdPtr+2) == '/' || *(fwdPtr+2) == '\\')) { - // remove ./ + // remove /. if followed by a slash or backslash fwdPtr += 1; } else if(*fwdPtr == '/' && *(fwdPtr+1) == '.' && *(fwdPtr+2) == '.' && - (*(fwdPtr+3) == '/' || *(fwdPtr+3) == '\0')) + (*(fwdPtr+3) == '/' || *(fwdPtr+3) == '\\' || + *(fwdPtr+3) == '\0')) { // remove foo/.. // reverse the urlPtr to the previous slash
Reporter | ||
Updated•25 years ago
|
Whiteboard: [PATCH]
Reporter | ||
Comment 1•25 years ago
|
||
The above patch attached.
Reporter | ||
Comment 2•25 years ago
|
||
You are right! I must be sleepy to have missed that... I will apply the patch and check it in soon. Thanks!
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Updated•25 years ago
|
Whiteboard: [PATCH] → [PATCH] asked reporter
Comment 4•25 years ago
|
||
brattel, can you verify that your patch was applied? thanks
Reporter | ||
Updated•25 years ago
|
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 5•25 years ago
|
||
It's applied ok.
Bulk move of all Networking-Core (to be deleted component) bugs to new Networking component.
Comment hidden (collapsed) |
You need to log in
before you can comment on or make changes to this bug.
Description
•