Commit 7a74a491b184125d2e5d2fb6e7604cc8506ea6de
1 parent
f4ca04ce
Fixes in appimage AppRun (fixes #789)
* Don't "shift" when $ARGV0 is a qpdf executable * Base -- to basename to avoid stuff like `qpdf --version` calling `basename --version`
Showing
1 changed file
with
5 additions
and
7 deletions
appimage/AppRun
| ... | ... | @@ -381,7 +381,7 @@ fi |
| 381 | 381 | if [ x"$1" == "xman" -o x"$1" == "x--man" ] ; then |
| 382 | 382 | export MANPATH="$HERE/usr/share/man:$MANPATH" |
| 383 | 383 | shift |
| 384 | - exec man "$@" || man $(basename $1) | |
| 384 | + exec man "$@" || man $(basename -- $1) | |
| 385 | 385 | fi |
| 386 | 386 | |
| 387 | 387 | |
| ... | ... | @@ -452,9 +452,9 @@ fi |
| 452 | 452 | ### Main stuff happens from here: |
| 453 | 453 | if [ ! -z $APPIMAGE ] ; then |
| 454 | 454 | # We run as an AppImage |
| 455 | - BINARY_NAME=$(basename "$ARGV0") | |
| 455 | + BINARY_NAME=$(basename -- "$ARGV0") | |
| 456 | 456 | APPIMAGE=$APPIMAGE |
| 457 | - CALLED_SUBCMD=$( basename $1 2>/dev/null ) | |
| 457 | + CALLED_SUBCMD=$( basename -- $1 2>/dev/null ) | |
| 458 | 458 | if [ "x$SET_SHOW_ENV_FOR_APPRUN" == "xYeSS" ] ; then |
| 459 | 459 | # We have the (hidden) env var for debugging stuff set |
| 460 | 460 | echo BINARY_NAME=$BINARY_NAME 1>&2 # Don't leak strings into output of qpdf|fix-pdf|zlib-flate going to stdout! |
| ... | ... | @@ -470,7 +470,6 @@ if [ ! -z $APPIMAGE ] ; then |
| 470 | 470 | echo APPIMAGE=$APPIMAGE 1>&2 # Don't leak strings into qpdf|fix-pdf|zlib-flate output going to stdout! |
| 471 | 471 | echo CALLED_SUBCMD=$CALLED_SUBCMD 1>&2 # Don't leak strings into qpdf|fix-pdf|zlib-flate output going to stdout! |
| 472 | 472 | fi |
| 473 | - shift | |
| 474 | 473 | exec "$HERE/usr/bin/$BINARY_NAME" "$@" |
| 475 | 474 | |
| 476 | 475 | else |
| ... | ... | @@ -504,9 +503,9 @@ if [ ! -z $APPIMAGE ] ; then |
| 504 | 503 | |
| 505 | 504 | else |
| 506 | 505 | # Most likely we run from an AppDir, not as an AppImage: |
| 507 | - BINARY_NAME=$(basename "$ARGV0") | |
| 506 | + BINARY_NAME=$(basename -- "$ARGV0") | |
| 508 | 507 | APPIMAGE=$APPIMAGE |
| 509 | - CALLED_SUBCMD=$( basename $1 2>/dev/null ) | |
| 508 | + CALLED_SUBCMD=$( basename -- $1 2>/dev/null ) | |
| 510 | 509 | if [ "x$SET_SHOW_ENV_FOR_APPRUN" == "xYeSS" ] ; then |
| 511 | 510 | # We have the (hidden) env var for debugging stuff set |
| 512 | 511 | echo BINARY_NAME=$BINARY_NAME 1>&2 # Don't leak strings into qpdf|fix-pdf|zlib-flate output going to stdout! |
| ... | ... | @@ -534,7 +533,6 @@ else |
| 534 | 533 | echo APPIMAGE=$APPIMAGE 1>&2 # Don't leak strings into qpdf|fix-pdf|zlib-flate output going to stdout! |
| 535 | 534 | echo CALLED_SUBCMD=$CALLED_SUBCMD 1>&2 # Don't leak strings into qpdf|fix-pdf|zlib-flate output going to stdout! |
| 536 | 535 | fi |
| 537 | - shift | |
| 538 | 536 | exec "$HERE/usr/bin/$BINARY_NAME" "$@" |
| 539 | 537 | |
| 540 | 538 | else | ... | ... |