summaryrefslogtreecommitdiffstats
path: root/lib/libedit/el.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2016-01-30 12:22:20 +0000
committerschwarze <schwarze@openbsd.org>2016-01-30 12:22:20 +0000
commit28d54ee83c6affd52032b6242140cc317714b94c (patch)
tree0ef5cda3e75bd5bab700bd54a1d43f60de5abb7b /lib/libedit/el.c
parentExplain how to run multiple copies of the same daemon; (diff)
downloadwireguard-openbsd-28d54ee83c6affd52032b6242140cc317714b94c.tar.xz
wireguard-openbsd-28d54ee83c6affd52032b6242140cc317714b94c.zip
Fourth step in synching with NetBSD:
KNF: Remove parentheses from return lines. No object change. This makes emacs.c and prompt.c identical to the NetBSD versions. It reduces the remaining diff from +2053 -1261 to +1526 -734. OK czarkoff@
Diffstat (limited to 'lib/libedit/el.c')
-rw-r--r--lib/libedit/el.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/libedit/el.c b/lib/libedit/el.c
index 9af4cc739aa..b0fd3e5c85b 100644
--- a/lib/libedit/el.c
+++ b/lib/libedit/el.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: el.c,v 1.22 2016/01/30 00:06:39 schwarze Exp $ */
+/* $OpenBSD: el.c,v 1.23 2016/01/30 12:22:20 schwarze Exp $ */
/* $NetBSD: el.c,v 1.61 2011/01/27 23:11:40 christos Exp $ */
/*-
@@ -57,7 +57,7 @@ el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr)
EditLine *el = (EditLine *) malloc(sizeof(EditLine));
if (el == NULL)
- return (NULL);
+ return NULL;
memset(el, 0, sizeof(EditLine));
@@ -102,7 +102,7 @@ el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr)
(void) sig_init(el);
(void) read_init(el);
- return (el);
+ return el;
}
@@ -161,7 +161,7 @@ FUN(el,set)(EditLine *el, int op, ...)
int rv = 0;
if (el == NULL)
- return (-1);
+ return -1;
va_start(ap, op);
switch (op) {
@@ -354,7 +354,7 @@ FUN(el,set)(EditLine *el, int op, ...)
}
va_end(ap);
- return (rv);
+ return rv;
}
@@ -476,7 +476,7 @@ FUN(el,get)(EditLine *el, int op, ...)
}
va_end(ap);
- return (rv);
+ return rv;
}
@@ -487,7 +487,7 @@ public const TYPE(LineInfo) *
FUN(el,line)(EditLine *el)
{
- return (const TYPE(LineInfo) *) (void *) &el->el_line;
+ return (const TYPE(LineInfo) *)(void *)&el->el_line;
}
@@ -511,13 +511,13 @@ el_source(EditLine *el, const char *fname)
static const char elpath[] = "/.editrc";
if (issetugid())
- return (-1);
+ return -1;
if ((ptr = getenv("HOME")) == NULL)
- return (-1);
+ return -1;
if (strlcpy(path, ptr, sizeof(path)) >= sizeof(path))
- return (-1);
+ return -1;
if (strlcat(path, elpath, sizeof(path)) >= sizeof(path))
- return (-1);
+ return -1;
fname = path;
#else
/*
@@ -525,13 +525,13 @@ el_source(EditLine *el, const char *fname)
* to keep from inadvertently opening up the user to a security
* hole.
*/
- return (-1);
+ return -1;
#endif
}
if (fp == NULL)
fp = fopen(fname, "r");
if (fp == NULL)
- return (-1);
+ return -1;
while ((ptr = fgetln(fp, &len)) != NULL) {
if (ptr[len - 1] == '\n')
@@ -539,7 +539,7 @@ el_source(EditLine *el, const char *fname)
else {
if ((lptr = (char *)malloc(len + 1)) == NULL) {
(void) fclose(fp);
- return (-1);
+ return -1;
}
memcpy(lptr, ptr, len);
lptr[len] = '\0';
@@ -558,12 +558,12 @@ el_source(EditLine *el, const char *fname)
if (parse_line(el, dptr) == -1) {
free(lptr);
(void) fclose(fp);
- return (-1);
+ return -1;
}
}
free(lptr);
(void) fclose(fp);
- return (0);
+ return 0;
}
@@ -609,7 +609,7 @@ el_editmode(EditLine *el, int argc, const Char **argv)
const Char *how;
if (argv == NULL || argc != 2 || argv[1] == NULL)
- return (-1);
+ return -1;
how = argv[1];
if (Strcmp(how, STR("on")) == 0) {
@@ -622,7 +622,7 @@ el_editmode(EditLine *el, int argc, const Char **argv)
else {
(void) fprintf(el->el_errfile, "edit: Bad value `" FSTR "'.\n",
how);
- return (-1);
+ return -1;
}
- return (0);
+ return 0;
}