summaryrefslogtreecommitdiffstats
path: root/googleurl/src/url_canon_relative.cc
diff options
context:
space:
mode:
Diffstat (limited to 'googleurl/src/url_canon_relative.cc')
-rw-r--r--googleurl/src/url_canon_relative.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/googleurl/src/url_canon_relative.cc b/googleurl/src/url_canon_relative.cc
index 446b951..6bcc72f 100644
--- a/googleurl/src/url_canon_relative.cc
+++ b/googleurl/src/url_canon_relative.cc
@@ -457,10 +457,11 @@ bool DoResolveRelativeURL(const char* base_url,
}
if (relative_component.len <= 0) {
- // Empty relative URL, make no changes.
+ // Empty relative URL, leave unchanged, only removing the ref component.
int base_len = base_parsed.Length();
- for (int i = 0; i < base_len; i++)
- output->push_back(base_url[i]);
+ base_len -= base_parsed.ref.len + 1;
+ out_parsed->ref.reset();
+ output->Append(base_url, base_len);
return true;
}