From ef1c1e53f7773db2d112242d6382248169ba51ed Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Wed, 28 Apr 2010 07:58:49 -0400 Subject: [PATCH] Check if there is the same name entry before inserting a new entry. SVN-Revision: 2329 --- libarchive/archive_write_set_format_iso9660.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libarchive/archive_write_set_format_iso9660.c b/libarchive/archive_write_set_format_iso9660.c index 77ebd1df0..ddec3e900 100644 --- a/libarchive/archive_write_set_format_iso9660.c +++ b/libarchive/archive_write_set_format_iso9660.c @@ -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; -- 2.47.3