X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/cc1ae02e2ecebd5006fe481473fc1f15f92b121a..76ce8d6527ebcc7e9c73ac181f761df45cc0e1b6:/packages/termux-api/termux-share diff --git a/packages/termux-api/termux-share b/packages/termux-api/termux-share index 68044bdf..1c081888 100755 --- a/packages/termux-api/termux-share +++ b/packages/termux-api/termux-share @@ -43,6 +43,10 @@ esac done if [ $# -gt 1 ]; then echo "Only one file can be shared"; exit 1; fi -if [ $# != 0 ]; then PARAMS="$PARAMS --es file `realpath $1`"; fi -@TERMUX_API@ Share $PARAMS +if [ $# != 0 ]; then + # Note that the file path can contain whitespace. + @TERMUX_API@ Share $PARAMS --es file "`realpath "$1"`" +else + @TERMUX_API@ Share $PARAMS +fi