]> git.sur5r.net Git - openocd/commitdiff
* src/jim.c: remove bogus return value from if {[expr]} {xx} when
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 8 Jul 2008 12:05:58 +0000 (12:05 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 8 Jul 2008 12:05:58 +0000 (12:05 +0000)
{xx} is not run.

git-svn-id: svn://svn.berlios.de/openocd/trunk@773 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jim.c

index 88893b0da60a3a017e1616de13dfe6a8eab0650e..712ce74f570144ae4072aa2db87c34a5f93f8b2b 100644 (file)
--- a/src/jim.c
+++ b/src/jim.c
@@ -10033,7 +10033,10 @@ static int Jim_IfCoreCommand(Jim_Interp *interp, int argc,
             if (boolean)
                 return Jim_EvalObj(interp, argv[current]);
              /* Ok: no else-clause follows */
-            if (++current >= argc) return JIM_OK;
+            if (++current >= argc) {
+               Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));                   
+               return JIM_OK;
+            }
             falsebody = current++;
             if (Jim_CompareStringImmediate(interp, argv[falsebody],
                         "else")) {