diff options
author | Max Kellermann <max@duempel.org> | 2016-03-07 14:01:40 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2016-03-07 14:01:40 +0100 |
commit | c46fc4531b10d6b53a646897e76559a2e3817ec7 (patch) | |
tree | e42c55c9c6743039cfa2f24715ab5b8f0ad37f34 /src/archive | |
parent | 065a9ed10f7a8600e867879b3e9c683df283c7b0 (diff) |
archive/iso9660: move the "." and ".." checks up
Diffstat (limited to 'src/archive')
-rw-r--r-- | src/archive/plugins/Iso9660ArchivePlugin.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/archive/plugins/Iso9660ArchivePlugin.cxx b/src/archive/plugins/Iso9660ArchivePlugin.cxx index 6c71f9ba0..f56c608b1 100644 --- a/src/archive/plugins/Iso9660ArchivePlugin.cxx +++ b/src/archive/plugins/Iso9660ArchivePlugin.cxx @@ -98,15 +98,15 @@ Iso9660ArchiveFile::Visit(const char *psz_path, ArchiveVisitor &visitor) auto *statbuf = (iso9660_stat_t *) _cdio_list_node_data(entnode); const char *filename = statbuf->filename; + if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0) + continue; strcpy(pathname, psz_path); strcat(pathname, filename); if (iso9660_stat_s::_STAT_DIR == statbuf->type ) { - if (strcmp(filename, ".") && strcmp(filename, "..")) { - strcat(pathname, "/"); - Visit(pathname, visitor); - } + strcat(pathname, "/"); + Visit(pathname, visitor); } else { //remove leading / visitor.VisitArchiveEntry(pathname + 1); |