diff options
Diffstat (limited to 'Build/source/utils/asymptote/interact.cc')
-rw-r--r-- | Build/source/utils/asymptote/interact.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Build/source/utils/asymptote/interact.cc b/Build/source/utils/asymptote/interact.cc index cc172984ac8..70569d1505c 100644 --- a/Build/source/utils/asymptote/interact.cc +++ b/Build/source/utils/asymptote/interact.cc @@ -56,18 +56,20 @@ void init_completion() { rl_completion_append_character='\0'; // Don't add a space after a match. + /* // Build a string containing all characters that separate words to be // completed. All characters that can't form part of an identifier are // treated as break characters. static char break_characters[128]; Int j=0; - for (unsigned char c=9; c<128; ++c) + for (unsigned char c=9; c < 128; ++c) if (!isalnum(c) && c != '_') { break_characters[j]=c; ++j; } break_characters[j]='\0'; rl_completer_word_break_characters=break_characters; + */ } #endif @@ -88,9 +90,8 @@ char *readpipeline(const char *prompt) { #if _POSIX_VERSION >= 200809L char *line=NULL; - size_t n; - getline(&line,&n,fin); - return line; + size_t n=0; + return getline(&line,&n,fin) >= 0 ? line : NULL; #else const int max_size=256; static char buf[max_size]; @@ -134,8 +135,10 @@ string simpleline(string prompt) { // Rebind tab key, as the setting tabcompletion may be changed at runtime. pre_readline(); + Signal(SIGINT,SIG_IGN); // Get a line from the user. char *line=Readline(prompt.c_str()); + Signal(SIGINT,interruptHandler); // Reset scroll count. interact::lines=0; |