diff options
author | Jim Meyering <jim@meyering.net> | 2002-09-28 07:51:17 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-09-28 07:51:17 +0000 |
commit | 8c10d25fd0e66bbdd25160a97a06aac8363dce2f (patch) | |
tree | 53b80a47e06095ee411a5f686f5a4b498dcab7e8 | |
parent | 7c8156ca73d787af40b2c4d8c42147ce5cd89e04 (diff) | |
download | coreutils-8c10d25fd0e66bbdd25160a97a06aac8363dce2f.tar.xz |
Fix things so `mkdir -p' can create very deep directories, e.g.,
mkdir -p $(perl -e 'print "a/" x 40000') now works.
(main): For --parents (-p), call make_path with the
entire directory name, so we don't ever require that file operations
like stat or chmod be performed on the entire command line argument.
-rw-r--r-- | src/mkdir.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mkdir.c b/src/mkdir.c index 5df9c1849..382d8027b 100644 --- a/src/mkdir.c +++ b/src/mkdir.c @@ -149,13 +149,11 @@ main (int argc, char **argv) if (create_parents) { - char *parents = dir_name (argv[optind]); - fail = make_path (parents, parent_mode, parent_mode, + char *dir = argv[optind]; + fail = make_path (dir, newmode, parent_mode, -1, -1, 1, verbose_fmt_string); - free (parents); } - - if (fail == 0) + else { const char *dir = argv[optind]; int dir_created; |