version 1.24, 2007/01/02 16:43:45 |
version 1.25, 2007/01/10 02:13:23 |
|
|
(void)fprintf(stderr, "%s", prompt); |
(void)fprintf(stderr, "%s", prompt); |
if (isatty(STDIN_FILENO)) |
if (isatty(STDIN_FILENO)) |
(void)fprintf(stderr, ">> "); |
(void)fprintf(stderr, ">> "); |
|
clearerr(stdin); |
while ((buf = fgetln(stdin, &len)) != NULL) { |
while ((buf = fgetln(stdin, &len)) != NULL) { |
/* The last line may not be EOL terminated. */ |
/* The last line may not be EOL terminated. */ |
if (buf[0] == '.' && (len == 1 || buf[1] == '\n')) |
if (buf[0] == '.' && (len == 1 || buf[1] == '\n')) |
|
|
fflush(stderr); |
fflush(stderr); |
fflush(stdout); |
fflush(stdout); |
|
|
|
clearerr(stdin); |
if (isalpha(c = getchar())) |
if (isalpha(c = getchar())) |
c = tolower(c); |
c = tolower(c); |
if (c == defc || c == '\n' || (c == EOF && feof(stdin))) |
if (c == defc || c == '\n' || (c == EOF && feof(stdin))) |