Fixed non-readline command reader.
This commit is contained in:
parent
0871041787
commit
37dcbfce6e
12
main.c
12
main.c
|
@ -940,12 +940,18 @@ static char *readline(const char *prompt)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
for (;;) {
|
||||||
printf("(mspdebug) ");
|
printf("(mspdebug) ");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
if (!fgets(buf, LINE_BUF_SIZE, stdin))
|
if (fgets(buf, LINE_BUF_SIZE, stdin))
|
||||||
return buf;
|
return buf;
|
||||||
} while (!feof(stdin));
|
|
||||||
|
if (feof(stdin))
|
||||||
|
break;
|
||||||
|
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
free(buf);
|
free(buf);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue