wrong ebub filename created after conversion
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ebook-tools (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: epub-utils
I have used lit2epub to convert following file ~/books/bolito.lit
$ lit2epub ~/books/bolito.lit
the resulting file is called ~/books/b.epubo.lit
It looks like there is slight omission in file /usr/bin/lit2epub on line 28
Lines 27 - 31 are following
if [ "x$2" = "x" ]; then
EPUB=$(echo $1 | sed -e 's/.lit/.epub/')
else
EPUB=$2
fi
Command
echo $1 | sed -e 's/.lit/.epub/'
replaces the first occurrence of 'AnyCaracterRep
so, instead of replacig literal string '.lit' it replaces 'olit'
One of solutions might be
echo $1 | sed -e 's/[.]lit/.epub/'
making dot '.' a literal dot
This solution isn't perfect, because while it would correctly rename 'bolito.lit' to 'bolito.epub',
it will still fail to rename 'bolito(
Perhaps a better solution would be
echo $1 | sed -e 's/[.]lit$/.epub/'
the dollar character after [.]lit is an anchor metacharacter that represents the end of the string.
Sorry for not submitting proper diff with suggested change, but I have never used diff, so this is more foolproof.
Thank you guys for great work!
Changed in ebook-tools (Ubuntu): | |
status: | New → Fix Released |
This is fixed with ebook-tools >= 0.2.0, whose first version in Debian is 0.2.1-1.
Can you please close this bug?