Chromium Code Reviews| Index: url/third_party/mozilla/url_parse.cc |
| diff --git a/url/third_party/mozilla/url_parse.cc b/url/third_party/mozilla/url_parse.cc |
| index 62567969a6502b1d5bf4a781e078ca778f462fd9..23432ffaae906f19f074324f340d951e677c5555 100644 |
| --- a/url/third_party/mozilla/url_parse.cc |
| +++ b/url/third_party/mozilla/url_parse.cc |
| @@ -627,17 +627,10 @@ void DoExtractFileName(const CHAR* spec, |
| // parameter. The path should start with a slash, so we don't need to check |
| // the first one. |
|
asanka
2014/09/17 20:56:25
Update the comment?
I'd suggest adding a referenc
brettw
2014/10/14 18:28:55
Yes, this needs updating. The whole thing should b
|
| int file_end = path.end(); |
| - for (int i = path.end() - 1; i > path.begin; i--) { |
| + for (int i = path.end() - 1; i >= path.begin; i--) { |
| if (spec[i] == ';') { |
| file_end = i; |
| - break; |
| - } |
| - } |
| - |
| - // Now search backwards from the filename end to the previous slash |
| - // to find the beginning of the filename. |
| - for (int i = file_end - 1; i >= path.begin; i--) { |
| - if (IsURLSlash(spec[i])) { |
| + } else if (IsURLSlash(spec[i])) { |
| // File name is everything following this character to the end |
| *file_name = MakeRange(i + 1, file_end); |
| return; |