if (dir_arg)
{
int i;
+ bool cwd_not_restored = false;
for (i = 0; i < n_files; i++)
{
+ bool different_cwd;
+ if (cwd_not_restored && IS_RELATIVE_FILE_NAME (argv[optind]))
+ {
+ error (0, 0,
+ _("unable to create relative-named directory, %s,"
+ " due to prior failure to restore working directory"),
+ quote (argv[optind]));
+ ok = false;;
+ continue;
+ }
+
ok &=
make_dir_parents (file[i], mode, mode, owner_id, group_id, false,
- (x.verbose ? _("creating directory %s") : NULL));
+ (x.verbose ? _("creating directory %s") : NULL),
+ &different_cwd);
+ cwd_not_restored |= different_cwd;
}
}
else
that this option is intended mainly to help installers when the
distribution doesn't provide proper install rules. */
mode_t dir_mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
+ bool different_cwd; /* FIXME: use this */
ok = make_dir_parents (dest_dir, dir_mode, dir_mode,
owner_id, group_id, true,
- (x->verbose ? _("creating directory %s") : NULL));
+ (x->verbose ? _("creating directory %s") : NULL),
+ &different_cwd);
+ /* Ignore different_cwd, since this function is called at most once. */
}
free (dest_dir);