diff options
| author | christos <christos@NetBSD.org> | 2002-11-20 16:50:08 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2002-11-20 16:50:08 +0000 |
| commit | 4a97685c19a56825ec04dfe5b1117be87c15bcd5 (patch) | |
| tree | f986842ad8342731c85f3c41c9bead71b80382d1 /lib/libedit/read.c | |
| parent | 6cde54195b27ba9515f581a34bf8580bb63d3e63 (diff) | |
Fix problem with previous patches that broke vi history.
- c_gets() was usually returning a length, but sometimes
one of the CC_xxx values (which are small +ve integers)!
- fixed c_gets() by putting a ' ' under the cursor.
From David Laight.
Diffstat (limited to 'lib/libedit/read.c')
| -rw-r--r-- | lib/libedit/read.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libedit/read.c b/lib/libedit/read.c index f45c2b0484a..8dcdf12bef3 100644 --- a/lib/libedit/read.c +++ b/lib/libedit/read.c @@ -1,4 +1,4 @@ -/* $NetBSD: read.c,v 1.23 2002/11/15 14:32:34 christos Exp $ */ +/* $NetBSD: read.c,v 1.24 2002/11/20 16:50:08 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: read.c,v 1.23 2002/11/15 14:32:34 christos Exp $"); +__RCSID("$NetBSD: read.c,v 1.24 2002/11/20 16:50:08 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -428,6 +428,8 @@ el_gets(EditLine *el, int *nread) break; cp = &el->el_line.buffer[idx]; } + if (*cp == 4) /* ought to be stty eof */ + break; cp++; if (cp[-1] == '\r' || cp[-1] == '\n') break; |
