mirror of git://git.suckless.org/ubase
Simplify skipping "." and ".." in switch_root
This commit is contained in:
parent
33be4f39c2
commit
bed72cf409
|
@ -28,9 +28,8 @@ delete_content(const char *dir, dev_t curdevice)
|
|||
if (d) {
|
||||
for(; (dent = readdir(d)) ;) {
|
||||
/* skip ".." and "." */
|
||||
if (dent->d_name[0] == '.'
|
||||
&& ((dent->d_name[1] == '.' && dent->d_name[2] == 0)
|
||||
|| (dent->d_name[1] == 0)))
|
||||
if (strcmp(dent->d_name, ".") == 0 ||
|
||||
strcmp(dent->d_name, "..") == 0)
|
||||
continue;
|
||||
|
||||
/* build path and dive deeper */
|
||||
|
|
Loading…
Reference in New Issue