]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Check if there is the same name entry before inserting a new entry.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 28 Apr 2010 11:58:49 +0000 (07:58 -0400)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Wed, 28 Apr 2010 11:58:49 +0000 (07:58 -0400)
SVN-Revision: 2329

libarchive/archive_write_set_format_iso9660.c

index 77ebd1df0a90a754a347e1b9addbfed9dc8906b9..ddec3e900934eaa8c831794931db9f6b18408b26 100644 (file)
@@ -5464,6 +5464,15 @@ isoent_tree(struct archive_write *a, struct isoent *isoent)
                        dent = np;
                }
 
+               /* If the current directory is not new,
+                * Check whether there is the same name entry or not.
+               if (np == NULL) {
+                       np = isoent_find_child(curdir,
+                           isoent->file->basename.s);
+                       if (np != NULL)
+                               goto same_entry;
+               }
+
                /* Found out the parent directory where isoent can be
                 * inserted. */
                iso9660->cur_dirent = dent;