Files
booksprite/platform
Tomáš Janoušek 510b9abe6d handle multiple args in common/koreader.sh (#15271)
The previous handling had two problems:

- current dir only appended if argc == 1
- multiple args passed as one to reader.lua

As a result:

- `bin/koreader -v -d` doesn't work (reader.lua sees it as one arg)
- `bin/koreader -d abc.epub` doesn't work either (for the same reason)

The fix is to go through args one by one and use `set -- …` to keep them
as an array of args (preserves white-space and avoid unintended
expansions that might happen if we attempted to do some eval trickery
instead).

Note that reader.lua doesn't currently handle multiple file/dir args, so
we could instead just look at the last arg and add pwd to that one.
Unfortunately doing this in POSIX sh isn't any simpler than processing
all args. :-)

(While at it, use `$PWD` which is required by POSIX to always be
present.)

Tested with bash 5.3.9, busybox 1.37.0 and dash 0.5.12.
2026-04-21 22:59:55 +02:00
..
2026-04-18 19:16:42 +02:00