]> git.plutz.net Git - clickslide/blobdiff - clickslide.sh
switch for base64 implementation
[clickslide] / clickslide.sh
index 291130a35ba128217c205033a571cae8cb58a6e1..d42f4059b55bc2c1975195904c81d26245bd955a 100755 (executable)
@@ -4,12 +4,14 @@ 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; then
+    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; } \