Compare commits

..

1 Commits

Author SHA1 Message Date
benoitperrin 1abb470819 Fix adept_remove -O placing result in a nested sub-directory
With -O <dir>, 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.
2026-07-01 11:14:30 +02:00
+5 -1
View File
@@ -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"))