]> git.plutz.net Git - vhs_kurs/commitdiff
Squashed 'clickslide/' changes from eb622bf..6f30b5e
authorPaul Hänsch <paul@plutz.net>
Wed, 16 Oct 2019 12:14:17 +0000 (14:14 +0200)
committerPaul Hänsch <paul@plutz.net>
Wed, 16 Oct 2019 12:14:17 +0000 (14:14 +0200)
6f30b5e better portability

git-subtree-dir: clickslide
git-subtree-split: 6f30b5e9508fdeb5506d8fb1718db8c757329048

clickslide.sh

index b1fd229bb1851d3f31f9854a48c2776305c7e550..70249148a71f82eb3a862aa2307e506e43b1b612 100755 (executable)
@@ -8,6 +8,9 @@ _base64() {
   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;'
@@ -16,13 +19,13 @@ _base64() {
 
 { "${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
@@ -30,7 +33,7 @@ _base64() {
   "
     else
       # $line is shortened by segment added to $tag
-      line="${line#*>}"
+      read -r line
       tag="${tag}>"
     fi