diff options
-rw-r--r-- | lib/mkdir-p.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mkdir-p.c b/lib/mkdir-p.c index a6572a41b..97775eb55 100644 --- a/lib/mkdir-p.c +++ b/lib/mkdir-p.c @@ -319,7 +319,8 @@ make_dir_parents (char const *arg, for (; leading_dirs != NULL; leading_dirs = leading_dirs->next) { leading_dirs->dirname_end[0] = '\0'; - if (cwd_problem || chmod (full_dir, parent_mode) != 0) + if ((cwd_problem && *full_dir != '/') + || chmod (full_dir, parent_mode) != 0) { error (0, (cwd_problem ? 0 : errno), _("cannot change permissions of %s"), quote (full_dir)); |