From 1abb470819c58f28b8ce9cf2d1692b8e0b251d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Perrin?= Date: Mon, 29 Jun 2026 15:31:04 +0200 Subject: [PATCH] Fix adept_remove -O placing result in a nested sub-directory With -O , the output path was built from the full input path instead of its base name: filename = std::string(inputFile); if (outputDir) filename = std::string(outputDir) + "/" + filename; So `adept_remove -O /out /tmp/x/book.epub` wrote the result to /out/tmp/x/book.epub (createPath() silently creating the intermediate directories) instead of /out/book.epub. -O is documented as the directory "were to put result", so only the input's base name should be appended. acsmdownloader is unaffected because it derives its output name from the title metadata, not from the input path. Reduce the input to its base name before prefixing it with -O. --- utils/adept_remove.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/adept_remove.cpp b/utils/adept_remove.cpp index 47112ab..d72b321 100644 --- a/utils/adept_remove.cpp +++ b/utils/adept_remove.cpp @@ -88,7 +88,11 @@ public: filename = std::string(inputFile); if (outputDir) - filename = std::string(outputDir) + "/" + filename; + { + char* basepath = strdup(inputFile); + filename = std::string(outputDir) + "/" + basename(basepath); + free(basepath); + } } if (endsWith(filename, ".epub"))