From 0f471f88109124ef5f8bf346e40a31dc77d60413 Mon Sep 17 00:00:00 2001 From: vsc Date: Fri, 24 May 2002 05:14:46 +0000 Subject: [PATCH] I/O fixes: get_quoted would go through EOF, check if answer replied EOF when asking for more solutions, readline in stream == 0 not 2. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@491 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/iopreds.c | 2 +- C/scanner.c | 4 ++++ pl/boot.yap | 8 +++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/C/iopreds.c b/C/iopreds.c index 682ff3ac1..e2190b395 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -908,7 +908,7 @@ ReadlineGetc(int sno) char *cptr = Prompt, ch; if ((Stream[FileAliases[2].alias_stream].status & Tty_Stream_f) && - Stream[FileAliases[2].alias_stream].u.file.name == Stream[sno].u.file.name) { + Stream[FileAliases[0].alias_stream].u.file.name == Stream[sno].u.file.name) { /* don't just output the prompt */ while ((ch = *cptr++) != '\0') { console_count_output_char(ch,Stream+StdErrStream,StdErrStream); diff --git a/C/scanner.c b/C/scanner.c index 1514387a2..a8e2b1041 100644 --- a/C/scanner.c +++ b/C/scanner.c @@ -1428,6 +1428,10 @@ fast_tokenizer(void) *charp++ = ch; my_fgetch(); } + if (chtype[ch] == EF) { + kind = eot_tok; + break; + } ++len; if (charp > (char *)AuxSp - 1024) { /* Not enough space to read in the string. */ diff --git a/pl/boot.yap b/pl/boot.yap index f6b3876b0..d0df11f88 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -526,9 +526,11 @@ repeat :- '$repeat'. '$another' :- '$format'(user_error," ? ",[]), '$get0'(user_input,C), - ( C==59 -> - '$skip'(user_input,10),fail; - C==10 -> '$format'(user_error,"~n", []) + ( C== 0'; -> '$skip'(user_input,10), fail + ; + C== 10 -> '$format'(user_error,"~n", []) + ; + C== -1 -> halt ; '$skip'(user_input,10), '$ask_again_for_another' ).