From: Todd C. Miller Subject: Re: ksh: use strtonum() To: Omar Polo Cc: tech@openbsd.org Date: Mon, 26 Aug 2024 18:49:53 -0600 On Mon, 26 Aug 2024 23:43:54 +0200, Omar Polo wrote: > I don't think, because it is expected to handle also !-N which is > different from !N. > > It's the `start + rec + 1' part at the end of the function that handles > the negative numbers turning them into the offset of the _last_ nth > command, instead of the nth command. Ah, I see. So that: return start + rec + 1; is equivalent to: return rec + maxhist; OK millert@ - todd