(make_dir_parents): Don't let a failed chdir($PWD)

stop us from restricting permissions of just-created absolute-named
directories.
This commit is contained in:
Jim Meyering committed 2005-06-15 08:31:44 +00:00
1 parent 1c4348d7e8
commit d4145e48ed
1 file changed
+2 -1
+2 -1
View File
@@ -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));