summaryrefslogtreecommitdiffstats
path: root/netwerk/base/nsStandardURL.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-07-10 18:46:10 +0000
committerMoonchild <moonchild@palemoon.org>2020-07-10 18:46:10 +0000
commitf1b51be787c11090c8d9b2ec73255df7a67c7eb7 (patch)
tree9c6d35ce6f19e0fef3c47c7e2c152394854cf217 /netwerk/base/nsStandardURL.cpp
parent2deaddfca28508ac1a634eb6088a1da8e571ec6e (diff)
parent82faff19e1761797b7a75f9221f0709c5a38bfe6 (diff)
downloadUXP-f1b51be787c11090c8d9b2ec73255df7a67c7eb7.tar
UXP-f1b51be787c11090c8d9b2ec73255df7a67c7eb7.tar.gz
UXP-f1b51be787c11090c8d9b2ec73255df7a67c7eb7.tar.lz
UXP-f1b51be787c11090c8d9b2ec73255df7a67c7eb7.tar.xz
UXP-f1b51be787c11090c8d9b2ec73255df7a67c7eb7.zip
Merge branch 'redwood' into releaseRELBASE_20200711
Diffstat (limited to 'netwerk/base/nsStandardURL.cpp')
-rw-r--r--netwerk/base/nsStandardURL.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp
index 81b485502..1866c1037 100644
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -2747,12 +2747,16 @@ nsStandardURL::SetFilePath(const nsACString &input)
return SetSpec(spec);
}
- else if (mPath.mLen > 1) {
+
+ if (mPath.mLen > 1) {
mSpec.Cut(mPath.mPos + 1, mFilepath.mLen - 1);
// left shift query, and ref
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 '/'
- mPath.mLen = 1;
mDirectory.mLen = 1;
mFilepath.mLen = 1;
// these are no longer defined