Index | Thread | Search

From:
Todd C. Miller <millert@openbsd.org>
Subject:
Re: ksh: use strtonum()
To:
Omar Polo <op@omarpolo.com>
Cc:
tech@openbsd.org
Date:
Mon, 26 Aug 2024 13:32:34 -0600

Download raw body.

Thread
On Mon, 26 Aug 2024 10:47:42 +0200, Omar Polo wrote:

> atoi() is only used in findhistrel(), which in turn is only used if you
> enable csh-like history.  findhistrel() is used only once in lex.c.  it
> is expected to return the item in the history array to lookup.
>
> Regress still passes (not suprising since csh-history is not tested) and
> runtime testing seems to behave just like before.  I do enable and use
> csh-style history expansion, but admittedly only in the most basic
> forms.

Shouldn't the low limit for strtonum() be 1 in this case?
It looks like findhistrel() returns success for values > 0.

 - todd