From: op Date: Tue, 27 Aug 2024 19:27:19 +0000 (+0000) Subject: inline `start' and simplify; from/ok millert@ X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8c6999ca73a8b697b93ede399ac5f743996958f0;p=openbsd inline `start' and simplify; from/ok millert@ --- diff --git a/bin/ksh/history.c b/bin/ksh/history.c index 6f4a1c8e571..dea44ad4480 100644 --- a/bin/ksh/history.c +++ b/bin/ksh/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.85 2024/08/27 18:45:58 op Exp $ */ +/* $OpenBSD: history.c,v 1.86 2024/08/27 19:27:19 op Exp $ */ /* * command history @@ -509,7 +509,6 @@ findhistrel(const char *str) { const char *errstr; int maxhist = histptr - history; - int start = maxhist - 1; int rec; rec = strtonum(str, -maxhist, maxhist, &errstr); @@ -520,7 +519,7 @@ findhistrel(const char *str) return -1; if (rec > 0) return rec - 1; - return start + rec + 1; + return maxhist + rec; } void