gcl.git - GNU Common Lisp

index : gcl.git
GNU Common Lisp
summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamm Maguire <camm@debian.org>2014年09月27日 13:51:54 -0400
committerCamm Maguire <camm@debian.org>2014年09月27日 13:51:54 -0400
commit3907ff3e6ac8584db3f157a6255479c427615312 (patch)
treec182d85f5635cd4c55977a3478dc984c2fff03aa
parentf69ba9b7f01800ac570f8ffe20456250aa4d7ea3 (diff)
downloadgcl-3907ff3e6ac8584db3f157a6255479c427615312.tar.gz
wrap getc/putc in BEGIN/END_NO_INTERRUPT
Diffstat
-rw-r--r--gcl/o/gcl_readline.d 26
1 files changed, 22 insertions, 4 deletions
diff --git a/gcl/o/gcl_readline.d b/gcl/o/gcl_readline.d
index ff27664b6..e3fdc1efa 100644
--- a/gcl/o/gcl_readline.d
+++ b/gcl/o/gcl_readline.d
@@ -175,6 +175,24 @@ typedef char *rl_compentry_func_t(const char *, int);
#endif
+static int
+my_getc(FILE *f) {
+ int c;
+ BEGIN_NO_INTERRUPT;
+ c=getc(f);
+ END_NO_INTERRUPT;
+ return c;
+}
+
+static int
+my_putc(int c,FILE *f) {
+ BEGIN_NO_INTERRUPT;
+ c=putc(c,f);
+ END_NO_INTERRUPT;
+ return c;
+}
+
+
int rl_putc_em(int c, FILE *f) {
static int allocated_length = 0;
@@ -205,7 +223,7 @@ int rl_putc_em(int c, FILE *f) {
rl_putc_em_line[current_length] = 0;
tail:
- return putc(c, f);
+ return my_putc(c, f);
}
@@ -233,7 +251,7 @@ call_readline() {
line=malloc(1);
line[0]=0;
} else {
- putc('\r', stdout);
+ my_putc('\r', stdout);
sigaction(SIGINT,&siga,&old_siga);
line=readline(rl_putc_em_line);
sigaction(SIGINT,&old_siga,NULL);
@@ -250,7 +268,7 @@ int rl_getc_em(FILE *f) {
static char *line;
static int linepos;
- if (f!=stdin || !isatty(fileno(f))) return getc(f);
+ if (f!=stdin || !isatty(fileno(f))) return my_getc(f);
if (rl_ungetc_em_char!=-1) {
int r = rl_ungetc_em_char;
@@ -280,7 +298,7 @@ int rl_getc_em(FILE *f) {
nlp=1;
}
- c=getc(f);
+ c=my_getc(f);
if (c==10) nlp=0;
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月04日 19:53:15 +0000

AltStyle によって変換されたページ (->オリジナル) /