summaryrefslogtreecommitdiffstats
path: root/lib/libedit/hist.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/hist.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/hist.c')
-rw-r--r--lib/libedit/hist.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/libedit/hist.c b/lib/libedit/hist.c
index a749bc2c381..7440437747a 100644
--- a/lib/libedit/hist.c
+++ b/lib/libedit/hist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hist.c,v 1.10 2014/10/17 06:07:50 deraadt Exp $ */
+/* $OpenBSD: hist.c,v 1.11 2016/01/30 12:22:20 schwarze Exp $ */
/* $NetBSD: hist.c,v 1.17 2009/12/30 23:54:52 christos Exp $ */
/*-
@@ -54,9 +54,9 @@ hist_init(EditLine *el)
sizeof(*el->el_history.buf));
el->el_history.sz = EL_BUFSIZ;
if (el->el_history.buf == NULL)
- return (-1);
+ return -1;
el->el_history.last = el->el_history.buf;
- return (0);
+ return 0;
}
@@ -81,7 +81,7 @@ hist_set(EditLine *el, hist_fun_t fun, ptr_t ptr)
el->el_history.ref = ptr;
el->el_history.fun = fun;
- return (0);
+ return 0;
}
@@ -108,20 +108,20 @@ hist_get(EditLine *el)
#endif /* KSHVI */
el->el_line.cursor = el->el_line.lastchar;
- return (CC_REFRESH);
+ return CC_REFRESH;
}
if (el->el_history.ref == NULL)
- return (CC_ERROR);
+ return CC_ERROR;
hp = HIST_FIRST(el);
if (hp == NULL)
- return (CC_ERROR);
+ return CC_ERROR;
for (h = 1; h < el->el_history.eventno; h++)
if ((hp = HIST_NEXT(el)) == NULL) {
el->el_history.eventno = h;
- return (CC_ERROR);
+ return CC_ERROR;
}
(void) Strncpy(el->el_line.buffer, hp,
(size_t)(el->el_line.limit - el->el_line.buffer));
@@ -141,7 +141,7 @@ hist_get(EditLine *el)
#endif /* KSHVI */
el->el_line.cursor = el->el_line.lastchar;
- return (CC_REFRESH);
+ return CC_REFRESH;
}
@@ -156,7 +156,7 @@ hist_command(EditLine *el, int argc, const Char **argv)
HistEvent ev;
if (el->el_history.ref == NULL)
- return (-1);
+ return -1;
if (argc == 1 || Strcmp(argv[1], STR("list")) == 0) {
/* List history entries */
@@ -164,11 +164,11 @@ hist_command(EditLine *el, int argc, const Char **argv)
for (str = HIST_LAST(el); str != NULL; str = HIST_PREV(el))
(void) fprintf(el->el_outfile, "%d %s",
el->el_history.ev.num, ct_encode_string(str, &el->el_scratch));
- return (0);
+ return 0;
}
if (argc != 3)
- return (-1);
+ return -1;
num = (int)Strtol(argv[2], NULL, 0);