a few unit tests broke on windows, fix those bugs


git-svn-id: svn://svn.chromium.org/chrome/trunk/src@950 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/file_util.cc b/base/file_util.cc
index 4594144..fabb4ac 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -70,7 +70,8 @@
 }
   
 bool EndsWithSeparator(const std::wstring& path) {
-  bool is_sep = ((path)[path.length() - 1] == kPathSeparator);
+  bool is_sep = (path.length() > 0 && 
+      (path)[path.length() - 1] == kPathSeparator);
   return is_sep;
 }
 
@@ -108,7 +109,9 @@
 }
 
 std::wstring GetFilenameFromPath(const std::wstring& path) {
-  std::wstring::size_type pos = path.find_last_of(kPathSeparator);
+  // TODO(erikkay): fix this - it's not using kPathSeparator, but win unit test
+  // are exercising '/' as a path separator as well.
+  std::wstring::size_type pos = path.find_last_of(L"\\/");
   return std::wstring(path, pos == std::wstring::npos ? 0 : pos+1);
 }