diff options
Diffstat (limited to 'lib/libedit/hist.c')
-rw-r--r-- | lib/libedit/hist.c | 24 |
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); |