Martins commands patch
[fw/sdcc] / debugger / mcs51 / sdcdb.c
index d5c7a44becc444fd2b7f0f6ce7ff4849d7a64af8..328de243b79b1cecae6e603e74c77c1f07c57d2d 100644 (file)
@@ -836,7 +836,7 @@ int interpretCmd (char *s)
 
 static FILE *actualcmdfile=NULL ;
 static char *actualcmds=NULL;
-
+static int   stopcmdlist;
 /*-----------------------------------------------------------------*/
 /* getNextCmdLine get additional lines used by special commands    */
 /*-----------------------------------------------------------------*/
@@ -854,6 +854,11 @@ void setCmdLine( char *cmds )
     actualcmds = cmds;
 }
 
+void stopCommandList()
+{
+    stopcmdlist = 1;
+}
+
 /*-----------------------------------------------------------------*/
 /* commandLoop - the main command loop or loop over command file   */
 /*-----------------------------------------------------------------*/
@@ -882,6 +887,7 @@ static void commandLoop(FILE *cmdfile)
         {
             strcpy(cmdbuff,actualcmds);
             actualcmds = NULL;
+            stopcmdlist= 0;
             for ( line = cmdbuff; *line ; line = s )
             {
                 if ( (s=strchr(line ,'\n')))
@@ -900,6 +906,8 @@ static void commandLoop(FILE *cmdfile)
                     break;
                 }
                 *s = save_ch;
+                if ( stopcmdlist )
+                    break;
             }
         }
     }