Ensure that redirection is off before attempting to read next line.

This commit is contained in:
W. Eric Norum
2004-07-09 18:40:42 +00:00
parent f6e1d32b25
commit 99778934c1
+8 -2
View File
@@ -420,8 +420,7 @@ iocsh (const char *pathname)
argc = 0;
wasOkToBlock = epicsThreadIsOkToBlock(epicsThreadGetIdSelf());
epicsThreadSetOkToBlock(epicsThreadGetIdSelf(), 1);
while ((raw = epicsReadline(prompt, readlineContext)) != NULL) {
lineno++;
for (;;) {
/*
* Undo redirection
@@ -435,6 +434,13 @@ iocsh (const char *pathname)
}
stopRedirect(filename, lineno, redirects);
/*
* Read a line
*/
if ((raw = epicsReadline(prompt, readlineContext)) == NULL)
break;
lineno++;
/*
* Ignore comment lines other than to echo
* them if they came from a script.