changeset 332:9dc6f9e60f6a

Quote file names. Select last profimg in listentry.
author HIROSE Yuuji <yuuji@gentei.org>
date Fri, 21 Oct 2016 22:57:04 +0859
parents 1a60dfc56bb0
children 002cc900200a
files s4-funcs.sh
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/s4-funcs.sh	Fri Oct 21 18:53:46 2016 +0859
+++ b/s4-funcs.sh	Fri Oct 21 22:57:04 2016 +0859
@@ -1521,7 +1521,7 @@
   keycond="$3"
   whos="$keycond AND key='profimg' AND type LIKE 'file:image%'
 	 ORDER BY rowid DESC LIMIT 1"
-  [ -d "$dir" ] || mkdir "$dir"
+  [ -d "$dir" ] || mkdir -p "$dir"
   case "$4" in
     [Ss]) size=S ;;
     [Oo]) size=O ;;
@@ -1933,15 +1933,15 @@
 err newlnk=$lnk regmode=$regmode
     icondir=$dir/$id
     files=`getvalbyid $tbl profimg $id $icondir`
-    # Pick up only first icon
+    # Pick up only last icon
     echo "<div class=\"iconlist xy$thumbxy $type\">
 	<p class=\"tag _$tag\">$tag</p>" \
 	| _m4 $tagconv
     if [ -n "$files" ]; then
-      icon=`echo "$files"|head -1`
-      iconhref2 $icondir/$icon "$hrb+$lnk" "$gecos"
+      icon=`echo "$files"|tail -1`
+      iconhref2 "$icondir/$icon" "$hrb+$lnk" "$gecos"
     else
-      iconhref $dir/$deficon "$hrb+$lnk" "$gecos"
+      iconhref "$dir/$deficon" "$hrb+$lnk" "$gecos"
     fi
     echo "<br>$name${ownerp:+<br>$ownerp}"
     echo "</div>"

yatex.org