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

Unified Diff: trunk/src/base/files/file_path.cc

Issue 15095015: Revert 200603 "Make Windows traversal checking handle pathologic..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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 | trunk/src/base/files/file_path_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/base/files/file_path.cc
===================================================================
--- trunk/src/base/files/file_path.cc (revision 200609)
+++ trunk/src/base/files/file_path.cc (working copy)
@@ -553,15 +553,8 @@
std::vector<StringType>::const_iterator it = components.begin();
for (; it != components.end(); ++it) {
const StringType& component = *it;
- // Windows has odd, undocumented behavior with path components containing
- // only whitespace and . characters. So, if all we see is . and
- // whitespace, then we treat any .. sequence as referencing parent.
- // For simplicity we enforce this on all platforms.
- if (component.find_first_not_of(FILE_PATH_LITERAL(". \n\r\t")) ==
- std::string::npos &&
- component.find(kParentDirectory) != std::string::npos) {
+ if (component == kParentDirectory)
return true;
- }
}
return false;
}
« no previous file with comments | « no previous file | trunk/src/base/files/file_path_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698