@@ -14110,20 +14110,20 @@ static int Jim_UplevelCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *
1411014110/* [expr] */
1411114111static int Jim_ExprCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
1411214112{
14113- int retcode;
14114-
14115- if (argc == 2) {
14116- retcode = Jim_EvalExpression(interp, argv[1]);
14117- }
14118- else {
14113+ #ifdef JIM_COMPAT
14114+ if (argc > 2) {
14115+ int retcode;
1411914116 Jim_Obj *objPtr;
1412014117
1412114118 objPtr = Jim_ConcatObj(interp, argc - 1, argv + 1);
1412214119 Jim_IncrRefCount(objPtr);
1412314120 retcode = Jim_EvalExpression(interp, objPtr);
1412414121 Jim_DecrRefCount(interp, objPtr);
14122+
14123+ return retcode;
1412514124 }
14126- return retcode;
14125+ #endif
14126+ return Jim_EvalExpression(interp, argv[1]);
1412714127}
1412814128
1412914129static int JimBreakContinueHelper(Jim_Interp *interp, int argc, Jim_Obj *const *argv, int retcode)
@@ -16696,7 +16696,7 @@ static const struct jim_core_cmd_def_t {
1669616696 {"eval", Jim_EvalCoreCommand, 1, -1, "arg ?arg ...?" },
1669716697 {"exists", Jim_ExistsCoreCommand, 1, 2, "?-command|-proc|-alias|-channel|-var? name" },
1669816698 {"exit", Jim_ExitCoreCommand, 0, 1, "?exitCode?" },
16699- #ifndef JIM_COMPAT
16699+ #ifdef JIM_COMPAT
1670016700 {"expr", Jim_ExprCoreCommand, 1, -1, "expression ?...?" },
1670116701#else
1670216702 {"expr", Jim_ExprCoreCommand, 1, 1, "expression" },
0 commit comments