From: Michihiro NAKAJIMA Date: Wed, 28 Apr 2010 11:58:49 +0000 (-0400) Subject: Check if there is the same name entry before inserting a new entry. X-Git-Tag: v3.0.0a~1063 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef1c1e53f7773db2d112242d6382248169ba51ed;p=thirdparty%2Flibarchive.git Check if there is the same name entry before inserting a new entry. SVN-Revision: 2329 --- 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;