From 27fcc878a13e4151cb4797d3cb994b40784e8530 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 5 Aug 2010 02:00:35 +0200 Subject: [PATCH] Make sure rl_instream defaults to NULL and add rl_outstream. --- include/editline.h | 2 ++ src/editline.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/editline.h b/include/editline.h index de602be..18c7539 100644 --- a/include/editline.h +++ b/include/editline.h @@ -47,6 +47,8 @@ extern int rl_mark; extern int rl_end; extern char *rl_line_buffer; extern const char *rl_readline_name; +extern FILE *rl_instream; /* The stdio stream from which input is read. Defaults to stdin if NULL - Not supported yet! */ +extern FILE *rl_outstream; /* The stdio stream to which output is flushed. Defaults to stdout if NULL - Not supported yet! */ extern int el_no_echo; /* e.g under emacs, don't echo except prompt */ extern int el_hist_size; /* size of history scrollback buffer, default: 15 */ diff --git a/src/editline.c b/src/editline.c index 3bec483..d2e97a7 100644 --- a/src/editline.c +++ b/src/editline.c @@ -113,8 +113,9 @@ int rl_end; int rl_meta_chars = 0; /* Display 8-bit chars as the actual char(0) or as `M-x'(1)? */ char *rl_line_buffer; const char *rl_prompt; -const char *rl_readline_name;/* Set by calling program, for conditional parsing of ~/.inputrc - Not supported yet! */ -FILE *rl_instream; +const char *rl_readline_name; /* Set by calling program, for conditional parsing of ~/.inputrc - Not supported yet! */ +FILE *rl_instream = NULL; /* The stdio stream from which input is read. Defaults to stdin if NULL - Not supported yet! */ +FILE *rl_outstream = NULL; /* The stdio stream to which output is flushed. Defaults to stdout if NULL - Not supported yet! */ /* User definable callbacks. */ char **(*rl_attempted_completion_function)(const char *token, int start, int end);