diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-09-27 13:39:09 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-09-27 13:39:09 +0200 |
commit | 7a74a491b184125d2e5d2fb6e7604cc8506ea6de (patch) | |
tree | eb3b9744628267d0d52c9ebdfb67c18282302306 /appimage | |
parent | f4ca04cec1a0c4a3c8341ff15f68c06bed89c0d7 (diff) | |
download | qpdf-7a74a491b184125d2e5d2fb6e7604cc8506ea6de.tar.zst |
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`
Diffstat (limited to 'appimage')
-rw-r--r-- | appimage/AppRun | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/appimage/AppRun b/appimage/AppRun index ce2dd393..b7f54ff1 100644 --- a/appimage/AppRun +++ b/appimage/AppRun @@ -381,7 +381,7 @@ fi if [ x"$1" == "xman" -o x"$1" == "x--man" ] ; then export MANPATH="$HERE/usr/share/man:$MANPATH" shift - exec man "$@" || man $(basename $1) + exec man "$@" || man $(basename -- $1) fi @@ -452,9 +452,9 @@ fi ### Main stuff happens from here: if [ ! -z $APPIMAGE ] ; then # We run as an AppImage - BINARY_NAME=$(basename "$ARGV0") + BINARY_NAME=$(basename -- "$ARGV0") APPIMAGE=$APPIMAGE - CALLED_SUBCMD=$( basename $1 2>/dev/null ) + CALLED_SUBCMD=$( basename -- $1 2>/dev/null ) if [ "x$SET_SHOW_ENV_FOR_APPRUN" == "xYeSS" ] ; then # We have the (hidden) env var for debugging stuff set 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 echo APPIMAGE=$APPIMAGE 1>&2 # Don't leak strings into qpdf|fix-pdf|zlib-flate output going to stdout! echo CALLED_SUBCMD=$CALLED_SUBCMD 1>&2 # Don't leak strings into qpdf|fix-pdf|zlib-flate output going to stdout! fi - shift exec "$HERE/usr/bin/$BINARY_NAME" "$@" else @@ -504,9 +503,9 @@ if [ ! -z $APPIMAGE ] ; then else # Most likely we run from an AppDir, not as an AppImage: - BINARY_NAME=$(basename "$ARGV0") + BINARY_NAME=$(basename -- "$ARGV0") APPIMAGE=$APPIMAGE - CALLED_SUBCMD=$( basename $1 2>/dev/null ) + CALLED_SUBCMD=$( basename -- $1 2>/dev/null ) if [ "x$SET_SHOW_ENV_FOR_APPRUN" == "xYeSS" ] ; then # We have the (hidden) env var for debugging stuff set 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 echo APPIMAGE=$APPIMAGE 1>&2 # Don't leak strings into qpdf|fix-pdf|zlib-flate output going to stdout! echo CALLED_SUBCMD=$CALLED_SUBCMD 1>&2 # Don't leak strings into qpdf|fix-pdf|zlib-flate output going to stdout! fi - shift exec "$HERE/usr/bin/$BINARY_NAME" "$@" else |