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

Unified Diff: base/files/file_path.cc

Issue 1224553010: Replace base::str[n]casecmp with helper functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | base/strings/string_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_path.cc
diff --git a/base/files/file_path.cc b/base/files/file_path.cc
index 92123533aaa55d1ec72eb72be873ed3bbd021340..51656d26d3af5def139e62032e42cb2458f36b87 100644
--- a/base/files/file_path.cc
+++ b/base/files/file_path.cc
@@ -10,9 +10,6 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/pickle.h"
-
-// These includes are just for the *Hack functions, and should be removed
-// when those functions are removed.
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
@@ -1259,11 +1256,12 @@ int FilePath::CompareIgnoreCase(StringPieceType string1,
#else // << WIN. MACOSX | other (POSIX) >>
-// Generic (POSIX) implementation of file string comparison.
-// TODO(rolandsteiner) check if this is sufficient/correct.
+// Generic Posix system comparisons.
int FilePath::CompareIgnoreCase(StringPieceType string1,
StringPieceType string2) {
- int comparison = strcasecmp(string1.data(), string2.data());
+ // Specifically need null termianted strings for this API call.
+ int comparison = strcasecmp(string1.as_string().c_str(),
+ string2.as_string().c_str());
if (comparison < 0)
return -1;
if (comparison > 0)
« no previous file with comments | « no previous file | base/strings/string_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698