correctly handle output zip files in directories

This commit is contained in:
Patrick Brosi 2023-10-13 12:43:59 +02:00
parent 7a772486d0
commit cb606ef75f

View file

@ -50,7 +50,7 @@ void Writer::write(gtfs::Feed* sourceFeed, const std::string& path) const {
if (toZip) { if (toZip) {
const size_t slashIdx = path.rfind('/'); const size_t slashIdx = path.rfind('/');
if (slashIdx != std::string::npos) { if (slashIdx != std::string::npos) {
zipFileName = path.substr(slashIdx, -1); zipFileName = path.substr(slashIdx + 1, -1);
gtfsPath = path.substr(0, slashIdx); gtfsPath = path.substr(0, slashIdx);
} else { } else {
zipFileName = path; zipFileName = path;