mirror of
https://github.com/coreutils/coreutils.git
synced 2025-01-09 17:43:23 +08:00
(main): Adjust to new make_dir_parents convention.
This commit is contained in:
parent
f7bbc5d1a2
commit
7cc0d42200
@ -360,7 +360,6 @@ main (int argc, char **argv)
|
|||||||
bool cwd_not_restored = false;
|
bool cwd_not_restored = false;
|
||||||
for (i = 0; i < n_files; i++)
|
for (i = 0; i < n_files; i++)
|
||||||
{
|
{
|
||||||
bool different_cwd;
|
|
||||||
if (cwd_not_restored && IS_RELATIVE_FILE_NAME (argv[optind]))
|
if (cwd_not_restored && IS_RELATIVE_FILE_NAME (argv[optind]))
|
||||||
{
|
{
|
||||||
error (0, 0,
|
error (0, 0,
|
||||||
@ -374,8 +373,7 @@ main (int argc, char **argv)
|
|||||||
ok &=
|
ok &=
|
||||||
make_dir_parents (file[i], mode, mode, owner_id, group_id, false,
|
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);
|
||||||
cwd_not_restored |= different_cwd;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -87,7 +87,7 @@ main (int argc, char **argv)
|
|||||||
const char *verbose_fmt_string = NULL;
|
const char *verbose_fmt_string = NULL;
|
||||||
int exit_status = EXIT_SUCCESS;
|
int exit_status = EXIT_SUCCESS;
|
||||||
int optc;
|
int optc;
|
||||||
bool cwd_not_restored;
|
bool cwd_not_restored = false;
|
||||||
|
|
||||||
initialize_main (&argc, &argv);
|
initialize_main (&argc, &argv);
|
||||||
program_name = argv[0];
|
program_name = argv[0];
|
||||||
@ -146,8 +146,6 @@ main (int argc, char **argv)
|
|||||||
umask (umask_value);
|
umask (umask_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: when we assume C99, declare this here. */
|
|
||||||
cwd_not_restored = false;
|
|
||||||
for (; optind < argc; ++optind)
|
for (; optind < argc; ++optind)
|
||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
@ -163,12 +161,10 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
if (create_parents)
|
if (create_parents)
|
||||||
{
|
{
|
||||||
bool different_cwd;
|
|
||||||
char *dir = argv[optind];
|
char *dir = argv[optind];
|
||||||
ok = make_dir_parents (dir, newmode, parent_mode,
|
ok = make_dir_parents (dir, newmode, parent_mode,
|
||||||
-1, -1, true, verbose_fmt_string,
|
-1, -1, true, verbose_fmt_string,
|
||||||
&different_cwd);
|
&cwd_not_restored);
|
||||||
cwd_not_restored |= different_cwd;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user