If the entry leaf name is "." or ".." we need to resolve it.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24860 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-04-07 19:41:49 +00:00
parent 54045c2e44
commit 5822847842
2 changed files with 20 additions and 0 deletions

View File

@ -899,6 +899,16 @@ BEntry::set(int dirFD, const char *path, bool traverse)
return dirFD;
fdCloser.SetTo(dirFD);
}
} else if (strcmp(leafName, ".") == 0
|| strcmp(leafName, "..") == 0) {
// We have to resolve this to get the entry name. Just open
// the dir and let the next iteration deal with it.
dirFD = _kern_open_dir(-1, path);
if (dirFD < 0)
return dirFD;
fdCloser.SetTo(dirFD);
path = NULL;
continue;
} else {
int parentFD = _kern_open_dir(dirFD, dirPath);
if (parentFD < 0)

View File

@ -901,6 +901,16 @@ BEntry::set(int dirFD, const char *path, bool traverse)
return dirFD;
fdCloser.SetTo(dirFD);
}
} else if (strcmp(leafName, ".") == 0
|| strcmp(leafName, "..") == 0) {
// We have to resolve this to get the entry name. Just open
// the dir and let the next iteration deal with it.
dirFD = _kern_open_dir(-1, path);
if (dirFD < 0)
return dirFD;
fdCloser.SetTo(dirFD);
path = NULL;
continue;
} else {
int parentFD = _kern_open_dir(dirFD, dirPath);
if (parentFD < 0)