summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2018-11-09 14:19:08 (GMT)
committersebres <sebres@users.sourceforge.net>2018-11-09 14:19:08 (GMT)
commitddae61a859c90b865bf0d82684638b80522d7922 (patch)
treed93ee86d26bf127e94a4b21e24f6a87de4ce7216 /generic
parent75399e97a85433a3805da49a5a11350610a369ae (diff)
downloadtcl-ddae61a859c90b865bf0d82684638b80522d7922.zip
tcl-ddae61a859c90b865bf0d82684638b80522d7922.tar.gz
tcl-ddae61a859c90b865bf0d82684638b80522d7922.tar.bz2
closes [35a8f1c04a]: minimalist fix - beware of discrepancy between TclScanElement and TclConvertElement (prefer braces considering TCL_DONT_QUOTE_HASH in case of first list element)
Diffstat (limited to 'generic')
-rw-r--r--generic/tclUtil.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index fb5b21c..2a0d51a 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -944,6 +944,10 @@ TclScanElement(
int preferEscape = 0; /* Use preferences to track whether to use */
int preferBrace = 0; /* CONVERT_MASK mode. */
int braceCount = 0; /* Count of all braces '{' '}' seen. */
+
+ if ((*src == '#') && !(*flagPtr & TCL_DONT_QUOTE_HASH)) {
+ preferBrace = 1;
+ }
#endif
if ((p == NULL) || (length == 0) || ((*p == '\0') && (length == -1))) {