]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Stop trimming parent directories at iso9660 writer; users will decide
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sat, 9 Jul 2011 23:12:34 +0000 (19:12 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sat, 9 Jul 2011 23:12:34 +0000 (19:12 -0400)
how many components are stripped or renaming a part of path names they like.

SVN-Revision: 3463

libarchive/archive_write_set_format_iso9660.c

index e7163f02b27f4582a218cf907a23ec31a1009791..8d2c2b973a40da6fe09646d1003a6a13128dfa11 100644 (file)
@@ -987,7 +987,6 @@ static int  isoent_cmp_key(const struct archive_rb_node *,
 static int     isoent_add_child_head(struct isoent *, struct isoent *);
 static int     isoent_add_child_tail(struct isoent *, struct isoent *);
 static void    isoent_remove_child(struct isoent *, struct isoent *);
-static void    isoent_trim_root_directory(struct iso9660 *);
 static void    isoent_setup_directory_location(struct iso9660 *,
                    int, struct vdd *);
 static void    isoent_setup_file_location(struct iso9660 *, int);
@@ -1853,7 +1852,6 @@ iso9660_close(struct archive_write *a)
        if (iso9660->birth_time == 0)
 #endif
                time(&(iso9660->birth_time));
-       isoent_trim_root_directory(iso9660);
 
        /*
         * Prepare a bootable ISO image.
@@ -5262,31 +5260,6 @@ isoent_remove_child(struct isoent *parent, struct isoent *child)
            (struct archive_rb_node *)child);
 }
 
-/*
- * Trim extra directories.
- * If the root directory is a virtual directory and has one sub-directory
- * only, the sub-direcotry become a new root directory.
- */
-static void
-isoent_trim_root_directory(struct iso9660 *iso9660)
-{
-       struct isoent *rootent, *child;
-
-       rootent = iso9660->primary.rootent;
-       while (rootent->virtual) {
-               if (rootent->children.cnt != 1)
-                       break;
-               child = rootent->children.first;
-               if (child->dir) {
-                       _isoent_free(rootent);
-                       iso9660->primary.rootent = rootent = child;
-                       rootent->parent = rootent;
-                       iso9660->dircnt_max--;
-               } else
-                       break;
-       }
-}
-
 static int
 isoent_clone_tree(struct archive_write *a, struct isoent **nroot,
     struct isoent *root)