Commit c46fc453 authored by Max Kellermann's avatar Max Kellermann

archive/iso9660: move the "." and ".." checks up

parent 065a9ed1
...@@ -98,15 +98,15 @@ Iso9660ArchiveFile::Visit(const char *psz_path, ArchiveVisitor &visitor) ...@@ -98,15 +98,15 @@ Iso9660ArchiveFile::Visit(const char *psz_path, ArchiveVisitor &visitor)
auto *statbuf = (iso9660_stat_t *) auto *statbuf = (iso9660_stat_t *)
_cdio_list_node_data(entnode); _cdio_list_node_data(entnode);
const char *filename = statbuf->filename; const char *filename = statbuf->filename;
if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0)
continue;
strcpy(pathname, psz_path); strcpy(pathname, psz_path);
strcat(pathname, filename); strcat(pathname, filename);
if (iso9660_stat_s::_STAT_DIR == statbuf->type ) { if (iso9660_stat_s::_STAT_DIR == statbuf->type ) {
if (strcmp(filename, ".") && strcmp(filename, "..")) { strcat(pathname, "/");
strcat(pathname, "/"); Visit(pathname, visitor);
Visit(pathname, visitor);
}
} else { } else {
//remove leading / //remove leading /
visitor.VisitArchiveEntry(pathname + 1); visitor.VisitArchiveEntry(pathname + 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment