Unnecessary c_str()
This commit is contained in:
3
sdn.cpp
3
sdn.cpp
@@ -779,8 +779,7 @@ fun search (const wstring &needle) {
|
|||||||
fun is_ancestor_dir (const string &ancestor, const string &of) -> bool {
|
fun is_ancestor_dir (const string &ancestor, const string &of) -> bool {
|
||||||
if (strncmp (ancestor.c_str (), of.c_str (), ancestor.length ()))
|
if (strncmp (ancestor.c_str (), of.c_str (), ancestor.length ()))
|
||||||
return false;
|
return false;
|
||||||
return of.c_str ()[ancestor.length ()] == '/'
|
return of[ancestor.length ()] == '/' || (ancestor == "/" && ancestor != of);
|
||||||
|| (ancestor == "/" && ancestor != of);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun change_dir (const string &path) {
|
fun change_dir (const string &path) {
|
||||||
|
|||||||
Reference in New Issue
Block a user