replace all string::find_last_of() with string::rfind()

find_last_of was working properly only because it was searching
only for one character, string::rfind() is appropriate function
for this job.
This commit is contained in:
Andrzej Rybczak
2009-02-05 21:52:31 +01:00
parent e637d8f627
commit d68824f0f2
4 changed files with 13 additions and 13 deletions

View File

@@ -364,7 +364,7 @@ string FindSharedDir(const string &one, const string &two)
while (one.substr(0, i) == two.substr(0, i))
i++;
result = one.substr(0, i);
i = result.find_last_of("/");
i = result.rfind("/");
return i != string::npos ? result.substr(0, i) : "/";
}