diff --git a/CONTROL/control b/CONTROL/control index c60fcd5..8009fa8 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.0.8-4 +Version: 1.0.8-6 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.8),mongoose(>=3.0-9),jim(>=0.74-4),jim-oo,jim-sqlite3(>=0.74-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6) diff --git a/var/mongoose/html/browse/index.jim b/var/mongoose/html/browse/index.jim index 37455bf..923a536 100755 --- a/var/mongoose/html/browse/index.jim +++ b/var/mongoose/html/browse/index.jim @@ -308,9 +308,9 @@ proc s_time {a b} { } if {[catch {file stat $a l}]} { return 0} - set at $l(ctime) + set at $l(mtime) if {[catch {file stat $b l}]} { return 0} - set bt $l(ctime) + set bt $l(mtime) if {$at < $bt} { return -1 } if {$at > $bt} { return 1 } diff --git a/var/mongoose/lib/system.class b/var/mongoose/lib/system.class index 02620ee..b50f9e8 100644 --- a/var/mongoose/lib/system.class +++ b/var/mongoose/lib/system.class @@ -1,6 +1,7 @@ if {![exists -proc class]} { package require oo } if {![exists -proc sqlite3.open]} { package require sqlite3 } +if {![exists -proc binary]} { package require binary } class system {} @@ -179,6 +180,15 @@ proc {system busy} {} { proc {system inuse} {file} { # Is anything using the file? set file [file rootname [file tail $file]] + + # Escape any unicode characters to match lsof output. + foreach range [lreverse [\ + regexp -inline -indices -all -- {[\x80-\xff]} $file]] { + set i [lindex $range 0] + binary scan [string index $file $i] H2 hex + set file [string replace $file $i $i "\\x$hex"] + } + set c 0 foreach line [split [exec /mod/bin/lsof] "\n"] { if {[string first $file $line] >= 0} { incr c }