Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Unified Diff: src/url_canon_relative.cc

Issue 600087: When resolving URL, empty relative URL should remove ref component.... (Closed) Base URL: http://google-url.googlecode.com/svn/trunk/
Patch Set: Changed to use Append. Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/url_canon_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/url_canon_relative.cc
===================================================================
--- src/url_canon_relative.cc (revision 121)
+++ src/url_canon_relative.cc (working copy)
@@ -457,10 +457,11 @@
}
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;
}
« no previous file with comments | « no previous file | src/url_canon_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698