summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorericm <ericm>2000-01-28 16:38:34 (GMT)
committerericm <ericm>2000-01-28 16:38:34 (GMT)
commit7f1780c6f594cd00f51e77b191d7659f31e84743 (patch)
treecf5e1d8cdb70f1a76905008eba1cbfd83a2052c3 /library
parentce3b1a3fb5578366ca5a44cf0a5436abe27e7a92 (diff)
downloadtcl-7f1780c6f594cd00f51e77b191d7659f31e84743.zip
tcl-7f1780c6f594cd00f51e77b191d7659f31e84743.tar.gz
tcl-7f1780c6f594cd00f51e77b191d7659f31e84743.tar.bz2
* tests/pkg/magicchar.tcl:
* tests/autoMkindex.test: Test for fix for bug #2611. * library/auto.tcl: Fixed the regular expression that performs $ escaping before sourcing a file to index. It was erroneously adding \ escapes even to $'s that were already escaped, effectively "un-escaping" those $'s. (bug #2611).
Diffstat (limited to 'library')
-rw-r--r--library/auto.tcl9
1 files changed, 6 insertions, 3 deletions
diff --git a/library/auto.tcl b/library/auto.tcl
index ddb317b..07b3116 100644
--- a/library/auto.tcl
+++ b/library/auto.tcl
@@ -3,7 +3,7 @@
# utility procs formerly in init.tcl dealing with auto execution
# of commands and can be auto loaded themselves.
#
-# RCS: @(#) $Id: auto.tcl,v 1.4 2000/01/28 00:09:15 ericm Exp $
+# RCS: @(#) $Id: auto.tcl,v 1.5 2000/01/28 16:38:34 ericm Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
@@ -319,8 +319,11 @@ proc auto_mkindex_parser::mkindex {file} {
# interpreter: references like "$x" will fail since code is not
# really being executed and variables do not really exist.
# Be careful to escape all naked "$" before evaluating.
-
- regsub -all {([^\$])\$([^\$])} $contents {\1\\$\2} contents
+ regsub -expanded -all {
+ ([^\\](?:(?:\\\\)*)) # match any even number of backslashes ...
+ \$ # ... followed by an unescaped dollar sign ...
+ ([^\$]) # ... followed by anything but another dollar sign
+ } $contents {\1\\$\2} contents; # add one backslash for the dollar sign
set index ""
set contextStack ""