diff y4.cgi @ 11:3565d93c2fb1

add mpsplit.pl
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 20 Jul 2015 18:09:20 +0900
parents 63c0e22870bb
children f2204bd941d5
line wrap: on
line diff
--- a/y4.cgi	Mon Jul 20 11:53:05 2015 +0900
+++ b/y4.cgi	Mon Jul 20 18:09:20 2015 +0900
@@ -254,13 +254,11 @@
       putfooter; exit
     fi
     idir=`umask 002; mktempd` || exit 1
-    tmpfiles=$tmpfiles"${tmpfiles+ }$idir"
+    # tmpfiles=$tmpfiles"${tmpfiles+ }$idir"
     bin=$idir/$myname-$$.bin
-    ##sql="select quote(bin) from $2 where id='$3' and val='$4'"
-    sql="select quote(bin) from $2 where rowid='$3'"
-    sq $db "$sql" | xxd -r -p > $bin
-    # type=`sq $db "select type from $2 where id='$3' and val='$4'"`
-    tv=`sq $db "select type,val from $2 where rowid='$3'"`
+    sql="select quote(bin) from $2 where rowid='$3';"
+    sq $db "$sql" | unhexize > $bin
+    tv=`query "select type,val from $2 where rowid='$3';"`
     type=${tv%|*} fn=${tv#*|}
     err tv=$tv type=$type fn=$fn
     ct=${type#file:}
@@ -284,7 +282,7 @@
     ## contenttype "Image/jpeg"
     sql="select quote(b) from te where a='${2:-mikan.jpg}'"
     idir=`umask 002; mktempd` || exit 1
-    tmpfiles=$tmpfiles"${tmpfiles+ }$idir"
+    # tmpfiles=$tmpfiles"${tmpfiles+ }$idir"
     img=$idir/$myname-$$.bin
     db=b.sq3
     sqlite3 $db "$sql" | xxd -r -p > $img

yatex.org