chiark / gitweb /
termux-api: Handle path whitespace in termux-api
authorFredrik Fornwall <fredrik@fornwall.net>
Mon, 4 Jan 2016 22:16:55 +0000 (17:16 -0500)
committerFredrik Fornwall <fredrik@fornwall.net>
Mon, 4 Jan 2016 22:16:55 +0000 (17:16 -0500)
This closes #120.

packages/termux-api/build.sh
packages/termux-api/termux-share

index 702e7e3c210d503cb2a4a7e4edf81b7aa5e5b184..4e8ffca337c389e09666d04eaabbe324229cd799 100644 (file)
@@ -1,6 +1,6 @@
 TERMUX_PKG_HOMEPAGE=http://termux.com/add-ons/api/
 TERMUX_PKG_DESCRIPTION="Termux API commands"
-TERMUX_PKG_VERSION=0.10
+TERMUX_PKG_VERSION=0.11
 
 termux_step_make_install () {
         mkdir -p $TERMUX_PREFIX/bin
index 68044bdf7baf9af8e3955ece13d531f3edb4ef3d..1c08188886864d3feab26ff65d94ef3be49aa442 100755 (executable)
@@ -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