Fix listing files inside directory in pack file

When adding a directory path to the inventory of the pack, an empty file name was being added to the file list. That made `Directory.get_ntext()` signal end-of-list too early so that files in a subdirectory were missed.

Fixes #15801.
Helps with #16798.

(cherry picked from commit 536611704a)
This commit is contained in:
Pedro J. Estébanez 2018-03-18 14:04:50 +01:00 committed by Hein-Pieter van Braam
parent 52c710f25a
commit c07d588e80

View file

@ -88,7 +88,11 @@ void PackedData::add_path(const String &pkg_path, const String &path, uint64_t o
}
}
}
cd->files.insert(path.get_file());
String filename = path.get_file();
// Don't add as a file if the path points to a directoryy
if (!filename.empty()) {
cd->files.insert(filename);
}
}
}