diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c index c0a9ffd0d9cd..5bb41c3a8a38 100644 --- a/bin/mkdir/mkdir.c +++ b/bin/mkdir/mkdir.c @@ -147,7 +147,7 @@ build(char *path, mode_t omode) else if (p[0] != '/') continue; *p = '\0'; - if (p[1] == '\0') + if (!last && p[1] == '\0') last = 1; if (first) { /*