Unnecessary c_str()

This commit is contained in:
Přemysl Eric Janouch 2018-11-02 12:35:03 +01:00
parent 4ab0db3c04
commit beee2e2683
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 1 additions and 2 deletions

View File

@ -779,8 +779,7 @@ fun search (const wstring &needle) {
fun is_ancestor_dir (const string &ancestor, const string &of) -> bool {
if (strncmp (ancestor.c_str (), of.c_str (), ancestor.length ()))
return false;
return of.c_str ()[ancestor.length ()] == '/'
|| (ancestor == "/" && ancestor != of);
return of[ancestor.length ()] == '/' || (ancestor == "/" && ancestor != of);
}
fun change_dir (const string &path) {