/*
- Copyright 2015, 2016 IoT.bzh
+ Copyright (C) 2015-2020 IoT.bzh
author: José Bollo <jose.bollo@iot.bzh>
workdir[1] = 0;
workdirfd = AT_FDCWD;
} else {
-
+
assert(length < sizeof workdir);
memcpy(workdir, name, 1 + length);
workdirfd = fd;
return -1;
}
+ /* check if . */
+ if (length == 1 && name[0] == '.') {
+ put_workdir(AT_FDCWD, name, length);
+ return 0;
+ }
+
/* opens the directory */
dirfd = openat(AT_FDCWD, name, O_PATH|O_DIRECTORY|O_RDONLY);
if (dirfd < 0) {