Merge pull request #854 from Neilpang/dev

Dev
This commit is contained in:
neil 2017-05-20 11:28:26 +08:00 committed by GitHub
commit 048059ba1f

32
acme.sh
View File

@ -1,6 +1,6 @@
#!/usr/bin/env sh #!/usr/bin/env sh
VER=2.6.9 VER=2.7.0
PROJECT_NAME="acme.sh" PROJECT_NAME="acme.sh"
@ -450,31 +450,33 @@ _h2b() {
fi fi
hex=$(cat) hex=$(cat)
i=1 ic=""
j=2 jc=""
_debug2 _URGLY_PRINTF "$_URGLY_PRINTF" _debug2 _URGLY_PRINTF "$_URGLY_PRINTF"
if [ -z "$_URGLY_PRINTF" ]; then if [ -z "$_URGLY_PRINTF" ]; then
while true; do if _exists xargs; then
h="$(printf "%s" "$hex" | cut -c $i-$j)" _debug2 "xargs"
echo "$hex" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf
else
for h in $(echo "$hex" | sed 's/\([0-9A-F]\{2\}\)/ \1/gI'); do
if [ -z "$h" ]; then if [ -z "$h" ]; then
break break
fi fi
printf "\x$h%s" printf "\x$h%s"
i="$(_math "$i" + 2)"
j="$(_math "$j" + 2)"
done done
else
while true; do
ic="$(printf "%s" "$hex" | cut -c $i)"
jc="$(printf "%s" "$hex" | cut -c $j)"
if [ -z "$ic$jc" ]; then
break
fi fi
else
for c in $(echo "$hex" | sed 's/\([0-9A-F]\)/ \1/gI'); do
if [ -z "$ic" ]; then
ic=$c
continue
fi
jc=$c
ic="$(_h_char_2_dec "$ic")" ic="$(_h_char_2_dec "$ic")"
jc="$(_h_char_2_dec "$jc")" jc="$(_h_char_2_dec "$jc")"
printf '\'"$(printf "%o" "$(_math "$ic" \* 16 + $jc)")""%s" printf '\'"$(printf "%o" "$(_math "$ic" \* 16 + $jc)")""%s"
i="$(_math "$i" + 2)" ic=""
j="$(_math "$j" + 2)" jc=""
done done
fi fi