diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-19 19:49:16 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-19 19:49:16 +0000 |
commit | 1b45fafeb5569d5da2c5e04e77c0548d48223277 (patch) | |
tree | 57bb53301a24588a466693aa1cdf7e68a6bb45ea /base/clipboard_util.cc | |
parent | 3a96c74353aae5bcc15867400927e52f05d9b7e6 (diff) | |
download | chromium_src-1b45fafeb5569d5da2c5e04e77c0548d48223277.zip chromium_src-1b45fafeb5569d5da2c5e04e77c0548d48223277.tar.gz chromium_src-1b45fafeb5569d5da2c5e04e77c0548d48223277.tar.bz2 |
fix unittests
We need to trim whitespace off the URL and handle the
tricky html case by using rfind.
Review URL: http://codereview.chromium.org/11465
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5701 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/clipboard_util.cc')
-rw-r--r-- | base/clipboard_util.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/base/clipboard_util.cc b/base/clipboard_util.cc index 5b64732..a9e7d2a 100644 --- a/base/clipboard_util.cc +++ b/base/clipboard_util.cc @@ -466,6 +466,7 @@ void ClipboardUtil::CFHtmlToHtml(const std::string& cf_html, size_t src_start = line_start + src_url_str.length(); if (src_end != std::string::npos && src_start != std::string::npos) { *base_url = cf_html.substr(src_start, src_end - src_start); + TrimWhitespace(*base_url, TRIM_ALL, base_url); } } @@ -474,7 +475,7 @@ void ClipboardUtil::CFHtmlToHtml(const std::string& cf_html, size_t markup_start = cf_html_lower.find("<html", 0); size_t tag_start = cf_html.find("StartFragment", markup_start); size_t fragment_start = cf_html.find('>', tag_start) + 1; - size_t tag_end = cf_html.find("EndFragment", fragment_start); + size_t tag_end = cf_html.rfind("EndFragment", std::string::npos); size_t fragment_end = cf_html.rfind('<', tag_end); if (fragment_start != std::string::npos && fragment_end != std::string::npos) { |