mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
fix bug 213012, unescape %2E during path coalescing, r=dveditz@netscape.com, sr=darin@meer.net
This commit is contained in:
parent
aa6c71196f
commit
0c241f3b41
@ -234,6 +234,34 @@ net_CoalesceDirs(netCoalesceFlags flags, char* path)
|
||||
special_ftp_len = 2;
|
||||
}
|
||||
|
||||
/* replace all %2E or %2e with . in the path */
|
||||
for(; (*fwdPtr != '\0') &&
|
||||
(*fwdPtr != '?') &&
|
||||
(*fwdPtr != '#'); ++fwdPtr)
|
||||
{
|
||||
if (*fwdPtr == '%' && *(fwdPtr+1) == '2' &&
|
||||
(*(fwdPtr+2) == 'E' || *(fwdPtr+2) == 'e'))
|
||||
{
|
||||
*urlPtr++ = '.';
|
||||
++fwdPtr;
|
||||
++fwdPtr;
|
||||
}
|
||||
else
|
||||
{
|
||||
*urlPtr++ = *fwdPtr;
|
||||
}
|
||||
}
|
||||
// Copy remaining stuff past the #?;
|
||||
for (; *fwdPtr != '\0'; ++fwdPtr)
|
||||
{
|
||||
*urlPtr++ = *fwdPtr;
|
||||
}
|
||||
*urlPtr = '\0'; // terminate the url
|
||||
|
||||
// start again, this time for real
|
||||
fwdPtr = path;
|
||||
urlPtr = path;
|
||||
|
||||
for(; (*fwdPtr != '\0') &&
|
||||
(*fwdPtr != '?') &&
|
||||
(*fwdPtr != '#'); ++fwdPtr)
|
||||
|
Loading…
Reference in New Issue
Block a user