From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Seitz To: Insight Maling List Subject: [PATCH] Update prefs regexps Date: Thu, 27 Sep 2001 07:47:00 -0000 Message-id: X-SW-Source: 2001-q3/msg00293.html Hi, With the new Tcl8.3 upgrade, preferences were broken. I've been using this patch for a little while now, so I think it is correct. If anyone runs into any more problems with this, please speak up. Keith ChangeLog 2001-09-27 Keith Seitz * library/prefs.tcl (escape_value): Update to work with Tcl's new and old syntax. Patch Index: library/prefs.tcl =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/library/prefs.tcl,v retrieving revision 1.12 diff -u -p -r1.12 prefs.tcl --- prefs.tcl 2001/08/22 21:11:16 1.12 +++ prefs.tcl 2001/09/27 14:45:50 @@ -217,7 +217,12 @@ proc escape_value {val} { # We use a URL-style quoting. We encode `=', `%', the `[]' # characters and newlines. We use a cute trick here: we regsub in # command expressions which we then expand using subst. - regsub -all -- "(\[\]\[=%\n\])" $val \ + if {[info tclversion] >= 8.1} { + set expr {([\[\]=%\n])} + } else { + set expr "(\[\]\[=%\n\])" + } + regsub -all -- $expr $val \ {[format "%%%02x" [scan {\1} %c x; set x]]} newval return [subst -nobackslashes -novariables $newval] }