summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2007-12-11 03:17:49 (GMT)
committerhobbs <hobbs>2007-12-11 03:17:49 (GMT)
commitcbdc6c0a1c95e7d6cb8836724ef4dbc91ab7ba2c (patch)
tree22e88baef7ee04c49e89029df1e2266d3a585912
parentcf51bd54b5a287a462f703664196dbbfbfc072f1 (diff)
downloadtcl-cbdc6c0a1c95e7d6cb8836724ef4dbc91ab7ba2c.zip
tcl-cbdc6c0a1c95e7d6cb8836724ef4dbc91ab7ba2c.tar.gz
tcl-cbdc6c0a1c95e7d6cb8836724ef4dbc91ab7ba2c.tar.bz2
* generic/tclUtil.c (TclReToGlob): reduce escapes in conversion
when not necessary
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclUtil.c14
2 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index bac7766..a653cab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2007-12-10 Jeff Hobbs <jeffh@ActiveState.com>
+ * generic/tclUtil.c (TclReToGlob): reduce escapes in conversion
+ when not necessary
+
* generic/tclInt.decls: move TclByteArrayMatch and TclReToGlob
* generic/tclIntDecls.h: to tclInt.h from stubs.
* generic/tclStubInit.c: Add flags var to TclByteArrayMatch for
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 35efcfd..a6d0e84 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUtil.c,v 1.94 2007/12/11 02:57:44 hobbs Exp $
+ * RCS: @(#) $Id: tclUtil.c,v 1.95 2007/12/11 03:17:49 hobbs Exp $
*/
#include "tclInt.h"
@@ -3340,17 +3340,19 @@ TclReToGlob(
case 'v':
*dsStr++ = '\v';
break;
- case 'B':
+ case 'B': case '\\':
*dsStr++ = '\\';
*dsStr++ = '\\';
anchorLeft = 0; /* prevent exact match */
break;
- case '\\': case '*': case '+': case '?':
- case '{': case '}': case '(': case ')': case '[': case ']':
- case '.': case '|': case '^': case '$':
+ case '*': case '[': case ']': case '?':
+ /* Only add \ where necessary for glob */
*dsStr++ = '\\';
- *dsStr++ = *p;
anchorLeft = 0; /* prevent exact match */
+ /* fall through */
+ case '{': case '}': case '(': case ')': case '+':
+ case '.': case '|': case '^': case '$':
+ *dsStr++ = *p;
break;
default:
msg = "invalid escape sequence";