From 166a37865e61ad3b22e24ce9356791037eab00c6 Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 5 Jun 2018 11:51:49 +0200 Subject: [PATCH] UrlEncode function now works with busybox --- dev/ofunctions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index 9de708d..5feaefd 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -10,7 +10,7 @@ #command line arguments don't take -AaqV for example _OFUNCTIONS_VERSION=2.3.0-dev -_OFUNCTIONS_BUILD=2018060401 +_OFUNCTIONS_BUILD=2018060501 #### _OFUNCTIONS_BOOTSTRAP SUBSET #### _OFUNCTIONS_BOOTSTRAP=true #### _OFUNCTIONS_BOOTSTRAP SUBSET END #### @@ -1348,12 +1348,12 @@ function HumanToNumeric { #### HumanToNumeric SUBSET END #### #### UrlEncode SUBSET #### -## from https://gist.github.com/cdown/1163649 +## Modified version of https://gist.github.com/cdown/1163649 function UrlEncode { local length="${#1}" local LANG=C - for (( i = 0; i < length; i++ )); do + for i in $(seq 0 $((length-1))); do local c="${1:i:1}" case $c in [a-zA-Z0-9.~_-])