diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-03-14 05:13:12 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-03-14 05:13:12 +0000 |
commit | 792987ae58d7eb73cd9316b0db73298133aedd0a (patch) | |
tree | df20288853f454d9c1b380583a13a9be108bbabd /lib/libedit/el.c | |
parent | 2619c4c4532a4d864fb1ca726290a4181e754cc3 (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/el.c')
-rw-r--r-- | lib/libedit/el.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/lib/libedit/el.c b/lib/libedit/el.c index 87bce35a04e..6df947c4901 100644 --- a/lib/libedit/el.c +++ b/lib/libedit/el.c @@ -1,4 +1,5 @@ -/* $OpenBSD: el.c,v 1.4 1997/01/16 05:18:31 millert Exp $ */ +/* $OpenBSD: el.c,v 1.5 1997/03/14 05:12:45 millert Exp $ */ +/* $NetBSD: el.c,v 1.3 1997/01/17 01:03:33 lukem Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -40,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94"; #else -static char rcsid[] = "$OpenBSD: el.c,v 1.4 1997/01/16 05:18:31 millert Exp $"; +static char rcsid[] = "$OpenBSD: el.c,v 1.5 1997/03/14 05:12:45 millert Exp $"; #endif #endif /* not lint && not SCCSID */ @@ -88,7 +89,7 @@ el_init(prog, fin, fout) el->el_errfile = fopen(tty, "w"); if (el->el_errfile == NULL) { extern errno; - (void) fprintf(stderr, "Cannot open %s (%s).\n", + (void)fprintf(stderr, "Cannot open %s (%s).\n", tty, strerror(errno)); return NULL; } @@ -100,15 +101,15 @@ el_init(prog, fin, fout) /* * Initialize all the modules. Order is important!!! */ - (void) term_init(el); - (void) tty_init(el); - (void) key_init(el); - (void) map_init(el); - (void) ch_init(el); - (void) search_init(el); - (void) hist_init(el); - (void) prompt_init(el); - (void) sig_init(el); + (void)term_init(el); + (void)tty_init(el); + (void)key_init(el); + (void)map_init(el); + (void)ch_init(el); + (void)search_init(el); + (void)hist_init(el); + (void)prompt_init(el); + (void)sig_init(el); el->el_flags = 0; return el; @@ -302,21 +303,22 @@ el_source(el, fname) return -1; fname = strncpy(path, ptr, sizeof(path) - 1); path[sizeof(path) - 1] = '\0'; - (void) strncat(path, elpath, sizeof(path) - strlen(path)); + (void)strncat(path, elpath, sizeof(path) - strlen(path)); } } if ((fp = fopen(fname, "r")) == NULL) return -1; - while ((ptr = fgetln(fp, &len)) != NULL) + while ((ptr = fgetln(fp, &len)) != NULL) { ptr[len - 1] = '\0'; if (parse_line(el, ptr) == -1) { - (void) fclose(fp); + (void)fclose(fp); return -1; } + } - (void) fclose(fp); + (void)fclose(fp); return 0; } @@ -330,13 +332,13 @@ el_resize(el) { int lins, cols; sigset_t oset, nset; - (void) sigemptyset(&nset); - (void) sigaddset(&nset, SIGWINCH); - (void) sigprocmask(SIG_BLOCK, &nset, &oset); + (void)sigemptyset(&nset); + (void)sigaddset(&nset, SIGWINCH); + (void)sigprocmask(SIG_BLOCK, &nset, &oset); /* get the correct window size */ if (term_get_size(el, &lins, &cols)) term_change_size(el, lins, cols); - (void) sigprocmask(SIG_SETMASK, &oset, NULL); + (void)sigprocmask(SIG_SETMASK, &oset, NULL); } |