X-Git-Url: http://git.plutz.net/?p=clickslide;a=blobdiff_plain;f=clickslide.sh;h=750b6b0c05380c918ab8426f61cc6ae21ea46956;hp=291130a35ba128217c205033a571cae8cb58a6e1;hb=HEAD;hpb=fc0b6d7e73f09538b0b0bb0e98d8ddc451c24e24 diff --git a/clickslide.sh b/clickslide.sh index 291130a..750b6b0 100755 --- a/clickslide.sh +++ b/clickslide.sh @@ -4,23 +4,28 @@ prev='' next='' idoff=0 depth=0 ucdepth=-1 _base64() { - { uuencode -m - <"$1" \ + # busybox does not ship base64, only uuencode. Other platforms might need base64 instead + if which uuencode >/dev/null; then + uuencode -m - <"$1" \ | sed '1d; :X;$!{N;bX;}; s;\n;;g; s;=\+;;g;' - } || { + elif which busybox >/dev/null; then + busybox uuencode -m - <"$1" \ + | sed '1d; :X;$!{N;bX;}; s;\n;;g; s;=\+;;g;' + else base64 <"$1" \ | sed ':X;$!{N;bX;}; s;\n;;g; s;=\+;;g;' - } + fi } { "${0%/*}"/cgilite/html-sh.sed || cat; } \ | { - line="$(line)" + read -r line while :; do tag="${tag}${line%%>*}" if [ "$line" = "${line%%>*}" ]; then # $line did not contain ">" and thus was added to $tag entirely - if ! line="$(line)"; then + if ! read -r line; then printf %s\\n "$tag" break fi