}
dir = ".."
parts = []string{filepath.Base(wd)}
- } else if parts[0] != "." {
+ } else {
// Relative path: start at the current directory
dir = "."
+ if parts[0] == "." {
+ parts = parts[1:]
+ }
}
dirFd, err := unix.Openat(unix.AT_FDCWD, dir, openReadonlyFlags, 0)