This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[PATCH] Update prefs regexps
- To: Insight Maling List <insight at sources dot redhat dot com>
- Subject: [PATCH] Update prefs regexps
- From: Keith Seitz <keiths at cygnus dot com>
- Date: Thu, 27 Sep 2001 07:47:45 -0700 (PDT)
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 <keiths@redhat.com>
* 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]
}