summaryrefslogtreecommitdiff
path: root/lib/libedit/read.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-03-14 05:13:12 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-03-14 05:13:12 +0000
commit792987ae58d7eb73cd9316b0db73298133aedd0a (patch)
treedf20288853f454d9c1b380583a13a9be108bbabd /lib/libedit/read.c
parent2619c4c4532a4d864fb1ca726290a4181e754cc3 (diff)
fix el_source() - a block needed braces around it (from NetBSD)
Some strcpy() -> strncpy (from NetBSD) Some KNF Add current NetBSD tags
Diffstat (limited to 'lib/libedit/read.c')
-rw-r--r--lib/libedit/read.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/lib/libedit/read.c b/lib/libedit/read.c
index 2d1139c6e82..55106d4cd73 100644
--- a/lib/libedit/read.c
+++ b/lib/libedit/read.c
@@ -1,4 +1,5 @@
-/* $OpenBSD: read.c,v 1.2 1997/01/16 05:18:42 millert Exp $ */
+/* $OpenBSD: read.c,v 1.3 1997/03/14 05:12:58 millert Exp $ */
+/* $NetBSD: read.c,v 1.3 1997/01/14 04:17:25 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -40,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
#else
-static char rcsid[] = "$OpenBSD: read.c,v 1.2 1997/01/16 05:18:42 millert Exp $";
+static char rcsid[] = "$OpenBSD: read.c,v 1.3 1997/03/14 05:12:58 millert Exp $";
#endif
#endif /* not lint && not SCCSID */
@@ -68,15 +69,15 @@ read_debug(el)
{
if (el->el_line.cursor > el->el_line.lastchar)
- (void) fprintf(el->el_errfile, "cursor > lastchar\r\n");
+ (void)fprintf(el->el_errfile, "cursor > lastchar\r\n");
if (el->el_line.cursor < el->el_line.buffer)
- (void) fprintf(el->el_errfile, "cursor < buffer\r\n");
+ (void)fprintf(el->el_errfile, "cursor < buffer\r\n");
if (el->el_line.cursor > el->el_line.limit)
- (void) fprintf(el->el_errfile, "cursor > limit\r\n");
+ (void)fprintf(el->el_errfile, "cursor > limit\r\n");
if (el->el_line.lastchar > el->el_line.limit)
- (void) fprintf(el->el_errfile, "lastchar > limit\r\n");
+ (void)fprintf(el->el_errfile, "lastchar > limit\r\n");
if (el->el_line.limit != &el->el_line.buffer[EL_BUFSIZ - 2])
- (void) fprintf(el->el_errfile, "limit != &buffer[EL_BUFSIZ-2]\r\n");
+ (void)fprintf(el->el_errfile, "limit != &buffer[EL_BUFSIZ-2]\r\n");
}
#endif /* DEBUG_EDIT */
@@ -151,7 +152,7 @@ read_preread(el)
return 0;
#ifdef FIONREAD
- (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) &chrs);
+ (void)ioctl(el->el_infd, FIONREAD, (ioctl_t) &chrs);
if (chrs > 0) {
char buf[EL_BUFSIZ];
@@ -282,13 +283,13 @@ el_getc(el, cp)
}
#ifdef DEBUG_READ
- (void) fprintf(el->el_errfile, "Turning raw mode on\n");
+ (void)fprintf(el->el_errfile, "Turning raw mode on\n");
#endif /* DEBUG_READ */
if (tty_rawmode(el) < 0) /* make sure the tty is set up correctly */
return 0;
#ifdef DEBUG_READ
- (void) fprintf(el->el_errfile, "Reading a character\n");
+ (void)fprintf(el->el_errfile, "Reading a character\n");
#endif /* DEBUG_READ */
while ((num_read = read(el->el_infd, (char *) &tcp, 1)) == -1)
if (!tried && read__fixio(el->el_infd, errno) == 0)
@@ -298,7 +299,7 @@ el_getc(el, cp)
return -1;
}
#ifdef DEBUG_READ
- (void) fprintf(el->el_errfile, "Got it %c\n", tcp);
+ (void)fprintf(el->el_errfile, "Got it %c\n", tcp);
#endif /* DEBUG_READ */
*cp = tcp;
return num_read;
@@ -326,7 +327,7 @@ el_gets(el, nread)
if (el->el_tty.t_mode == EX_IO && ma->level < 0) {
long chrs = 0;
- (void) ioctl(el->el_infd, FIONREAD, (ioctl_t) &chrs);
+ (void)ioctl(el->el_infd, FIONREAD, (ioctl_t) &chrs);
if (chrs == 0) {
if (tty_rawmode(el) < 0) {
if (nread)
@@ -346,14 +347,14 @@ el_gets(el, nread)
/* if EOF or error */
if ((num = read_getcmd(el, &cmdnum, &ch)) != OKCMD) {
#ifdef DEBUG_READ
- (void) fprintf(el->el_errfile, "Returning from el_gets %d\n", num);
+ (void)fprintf(el->el_errfile, "Returning from el_gets %d\n", num);
#endif /* DEBUG_READ */
break;
}
if (cmdnum >= el->el_map.nfunc) { /* BUG CHECK command */
#ifdef DEBUG_EDIT
- (void) fprintf(el->el_errfile,
+ (void)fprintf(el->el_errfile,
"ERROR: illegal command from key 0%o\r\n", ch);
#endif /* DEBUG_EDIT */
continue; /* try again */
@@ -367,9 +368,9 @@ el_gets(el, nread)
if (b->func == cmdnum)
break;
if (b->name)
- (void) fprintf(el->el_errfile, "Executing %s\n", b->name);
+ (void)fprintf(el->el_errfile, "Executing %s\n", b->name);
else
- (void) fprintf(el->el_errfile, "Error command = %d\n", cmdnum);
+ (void)fprintf(el->el_errfile, "Error command = %d\n", cmdnum);
}
#endif /* DEBUG_READ */
retval = (*el->el_map.func[cmdnum])(el, ch);
@@ -415,7 +416,7 @@ el_gets(el, nread)
case CC_FATAL: /* fatal error, reset to known state */
#ifdef DEBUG_READ
- (void) fprintf(el->el_errfile, "*** editor fatal ERROR ***\r\n\n");
+ (void)fprintf(el->el_errfile, "*** editor fatal ERROR ***\r\n\n");
#endif /* DEBUG_READ */
/* put (real) cursor in a known place */
re_clear_display(el); /* reset the display stuff */
@@ -428,7 +429,7 @@ el_gets(el, nread)
case CC_ERROR:
default: /* functions we don't know about */
#ifdef DEBUG_READ
- (void) fprintf(el->el_errfile, "*** editor ERROR ***\r\n\n");
+ (void)fprintf(el->el_errfile, "*** editor ERROR ***\r\n\n");
#endif /* DEBUG_READ */
el->el_state.argument = 1;
el->el_state.doingarg = 0;
@@ -438,7 +439,7 @@ el_gets(el, nread)
}
}
- (void) tty_cookedmode(el); /* make sure the tty is set up correctly */
+ (void)tty_cookedmode(el); /* make sure the tty is set up correctly */
term__flush(); /* flush any buffered output */
if (el->el_flags & HANDLE_SIGNALS)
sig_clr(el);