Fixed non-readline command reader.

This commit is contained in:
Daniel Beer 2010-03-27 22:54:01 +13:00
parent 0871041787
commit 37dcbfce6e
1 changed files with 9 additions and 3 deletions

12
main.c
View File

@ -940,12 +940,18 @@ static char *readline(const char *prompt)
return NULL;
}
do {
for (;;) {
printf("(mspdebug) ");
fflush(stdout);
if (!fgets(buf, LINE_BUF_SIZE, stdin))
if (fgets(buf, LINE_BUF_SIZE, stdin))
return buf;
} while (!feof(stdin));
if (feof(stdin))
break;
printf("\n");
}
free(buf);
return NULL;