diff options
author | dgp <dgp@users.sourceforge.net> | 2018-11-13 21:10:33 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2018-11-13 21:10:33 (GMT) |
commit | 3e8ffff6a3663495e9cbc3fe5eb0dd1798904dbe (patch) | |
tree | ffc9422e6e57f2706528cb9e780a54717f2089a6 /generic/tclUtil.c | |
parent | ad8c23540cd977b9e923053d0e86a56207761680 (diff) | |
download | tcl-3e8ffff6a3663495e9cbc3fe5eb0dd1798904dbe.zip tcl-3e8ffff6a3663495e9cbc3fe5eb0dd1798904dbe.tar.gz tcl-3e8ffff6a3663495e9cbc3fe5eb0dd1798904dbe.tar.bz2 |
[35a8f1c04a] Fix bad lengths when creating string rep of some lists.
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r-- | generic/tclUtil.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index ea2c7a9..812bcad 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -1044,6 +1044,23 @@ TclScanElement( return 2; } +#if COMPAT + /* + * We have an established history in TclConvertElement() when quoting + * because of a leading hash character to force what would be the + * CONVERT_MASK mode into the CONVERT_BRACE mode. That is, we format + * the element #{a"b} like this: + * {#{a"b}} + * and not like this: + * \#{a\"b} + * This is inconsistent with [list x{a"b}], but we will not change that now. + * Set that preference here so that we compute a tight size requirement. + */ + if ((*src == '#') && !(*flagPtr & TCL_DONT_QUOTE_HASH)) { + preferBrace = 1; + } +#endif + if ((*p == '{') || (*p == '"')) { /* * Must escape or protect so leading character of value is not |