From 0b7de42218e68bc44b85b8df86dfdba5893134a2 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Mon, 15 Jun 2015 20:14:16 +0000 Subject: [PATCH] fix \ handling --- CONTROL/control | 2 +- webif/plugin/sweeper/auto.hook | 8 +++++--- webif/plugin/sweeper/rules_json.jim | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index ebe212e..b4b9b6d 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: sweeper Priority: optional Section: misc -Version: 2.0.8 +Version: 2.0.8-2 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif(>=1.2.2-6) diff --git a/webif/plugin/sweeper/auto.hook b/webif/plugin/sweeper/auto.hook index 054becd..cef9a29 100644 --- a/webif/plugin/sweeper/auto.hook +++ b/webif/plugin/sweeper/auto.hook @@ -129,7 +129,7 @@ proc ::sweeper::expand {ts str {orig ""}} { incr pos set e [string first $ch $ret $pos] if {$e == -1} { - log "Error. %$fn - $i/$numargs parameters found." + log "Error. %$fn - [llength $fnargs]/$numargs parameters found." break } lappend fnargs [string range $ret \ @@ -138,8 +138,10 @@ proc ::sweeper::expand {ts str {orig ""}} { } set ret [string replace $ret $i $pos] - log " - Calling expand_$fn\($fnargs)" 2 - ::sweeper::expand_$fn $ts ret {*}$fnargs + if {[llength $fnargs] == $numargs} { + log " - Calling expand_$fn\($fnargs)" 2 + ::sweeper::expand_$fn $ts ret {*}$fnargs + } } } diff --git a/webif/plugin/sweeper/rules_json.jim b/webif/plugin/sweeper/rules_json.jim index f5acc9c..e690176 100755 --- a/webif/plugin/sweeper/rules_json.jim +++ b/webif/plugin/sweeper/rules_json.jim @@ -46,7 +46,9 @@ proc add_json {str} { } proc quot {str} { - return [cgi_quote_html $str] + return [string map { + "\\" "\\\\" + } [cgi_quote_html $str]] } set composite {and or}