mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 23:27:30 +09:00
[network] Use query and ref lengths if available in nsStandardURL.
This commit is contained in:
parent
415542eb7c
commit
8d5005090a
1 changed files with 6 additions and 2 deletions
|
|
@ -2747,12 +2747,16 @@ nsStandardURL::SetFilePath(const nsACString &input)
|
||||||
|
|
||||||
return SetSpec(spec);
|
return SetSpec(spec);
|
||||||
}
|
}
|
||||||
else if (mPath.mLen > 1) {
|
|
||||||
|
if (mPath.mLen > 1) {
|
||||||
mSpec.Cut(mPath.mPos + 1, mFilepath.mLen - 1);
|
mSpec.Cut(mPath.mPos + 1, mFilepath.mLen - 1);
|
||||||
// left shift query, and ref
|
// left shift query, and ref
|
||||||
ShiftFromQuery(1 - mFilepath.mLen);
|
ShiftFromQuery(1 - mFilepath.mLen);
|
||||||
|
// One character for '/', and if we have a query or ref we add their
|
||||||
|
// length and one extra for each '?' or '#' characters
|
||||||
|
mPath.mLen = 1 + (mQuery.mLen >= 0 ? (mQuery.mLen + 1) : 0) +
|
||||||
|
(mRef.mLen >= 0 ? (mRef.mLen + 1) : 0);
|
||||||
// these contain only a '/'
|
// these contain only a '/'
|
||||||
mPath.mLen = 1;
|
|
||||||
mDirectory.mLen = 1;
|
mDirectory.mLen = 1;
|
||||||
mFilepath.mLen = 1;
|
mFilepath.mLen = 1;
|
||||||
// these are no longer defined
|
// these are no longer defined
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue