diff --git a/utils/adept_remove.cpp b/utils/adept_remove.cpp index 47112ab..b48bb07 100644 --- a/utils/adept_remove.cpp +++ b/utils/adept_remove.cpp @@ -88,7 +88,12 @@ public: filename = std::string(inputFile); if (outputDir) - filename = std::string(outputDir) + "/" + filename; + { + std::string _in(inputFile); + size_t _pos = _in.find_last_of('/'); + std::string _base = (_pos == std::string::npos) ? _in : _in.substr(_pos + 1); + filename = std::string(outputDir) + "/" + _base; + } } if (endsWith(filename, ".epub"))