diff options
author | Matt Kraai | 2001-08-24 19:51:54 +0000 |
---|---|---|
committer | Matt Kraai | 2001-08-24 19:51:54 +0000 |
commit | ac20ce1924a0eb563acfda6533a80701cd611bfa (patch) | |
tree | 5209668fde99a5caa4ed41d8d61c73770fcae646 /libbb/unarchive.c | |
parent | 2a953aed3831f8705444e720783ad4781904a625 (diff) | |
download | busybox-ac20ce1924a0eb563acfda6533a80701cd611bfa.zip busybox-ac20ce1924a0eb563acfda6533a80701cd611bfa.tar.gz |
Canonicalize dirname(3) behavior.
Diffstat (limited to 'libbb/unarchive.c')
-rw-r--r-- | libbb/unarchive.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libbb/unarchive.c b/libbb/unarchive.c index 0d414a3..2d171b4 100644 --- a/libbb/unarchive.c +++ b/libbb/unarchive.c @@ -127,13 +127,15 @@ char *extract_archive(FILE *src_stream, FILE *out_stream, const file_header_t *f } } if (function & extract_create_leading_dirs) { /* Create leading directories with default umask */ - char *parent = dirname(full_name); + char *buf, *parent; + buf = xstrdup(full_name); + parent = dirname(full_name); if (make_directory (parent, -1, FILEUTILS_RECUR) != 0) { if ((function & extract_quiet) != extract_quiet) { error_msg("couldn't create leading directories"); } } - free (parent); + free (buf); } switch(file_entry->mode & S_IFMT) { case S_IFREG: |