File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 109
109
/* Maximum size of an integer */
110
110
#define JIM_INTEGER_SPACE 24
111
111
112
- #if defined(DEBUG_SHOW_SCRIPT) || defined(DEBUG_SHOW_SCRIPT_TOKENS) || defined(JIM_DEBUG_COMMAND)
112
+ #if defined(DEBUG_SHOW_SCRIPT) || defined(DEBUG_SHOW_SCRIPT_TOKENS) || defined(JIM_DEBUG_COMMAND) || defined(DEBUG_SHOW_SUBST)
113
113
static const char *jim_tt_name(int type);
114
114
#endif
115
115
@@ -9273,7 +9273,7 @@ static int JimParseExprOperator(struct JimParserCtx *pc)
9273
9273
return JIM_OK;
9274
9274
}
9275
9275
9276
- #if (defined(DEBUG_SHOW_SCRIPT) || defined(DEBUG_SHOW_SCRIPT_TOKENS) || defined(JIM_DEBUG_COMMAND)) && !defined(JIM_BOOTSTRAP)
9276
+ #if (defined(DEBUG_SHOW_SCRIPT) || defined(DEBUG_SHOW_SCRIPT_TOKENS) || defined(JIM_DEBUG_COMMAND) || defined(DEBUG_SHOW_SUBST) ) && !defined(JIM_BOOTSTRAP)
9277
9277
static const char *jim_tt_name(int type)
9278
9278
{
9279
9279
static const char * const tt_names[JIM_TT_EXPR_OP] =
@@ -11736,7 +11736,9 @@ static void JimParseSubst(struct JimParserCtx *pc, int flags)
11736
11736
}
11737
11737
/* Not a var, so treat as a string */
11738
11738
pc->tstart = pc->p;
11739
- flags |= JIM_SUBST_NOVAR;
11739
+ /* Skip this $ */
11740
+ pc->p++;
11741
+ pc->len--;
11740
11742
}
11741
11743
while (pc->len) {
11742
11744
if (*pc->p == '$' && !(flags & JIM_SUBST_NOVAR)) {
Original file line number Diff line number Diff line change @@ -176,6 +176,11 @@ test subst-12.3 {variable inside [] with -noc} {
176
176
subst -noc {x[join $a]y}
177
177
} {x[join 1]y}
178
178
179
+ test subst-12.4 {variable after not variable} {
180
+ set a 1
181
+ subst -noc {$\[ $a}
182
+ } {$[ 1}
183
+
179
184
180
185
# cleanup
181
186
testreport
You can’t perform that action at this time.
0 commit comments