From: Stefan Sperling Subject: Re: regress/tog: enable in sha256 mode To: Mark Jamsek Cc: Christian Weisgerber , gameoftrees@openbsd.org Date: Wed, 7 Aug 2024 13:04:16 +0200 On Wed, Aug 07, 2024 at 08:58:47PM +1000, Mark Jamsek wrote: > Christian Weisgerber wrote: > > Stefan Sperling: > > > > > > +trim() > > > > +{ > > > > + expr "$2" : "\(.\{$1\}\)" > > > > +} > > > > > > Seems this returns an empty string if the input is shorter than > > > the requested trim amount. > > > > That can easily be changed by specifying a lower bound: > > > > expr "$2" : "\(.\{1,$1\}\)" > > oh nice! > > I was just tweaking the tests to work with both hash algos and it's > more fiddly then I anticipated. > > I think op's tweak with your fix is the best way to go. Thanks :) > > op, your diff with naddy's fix is ok for me Works here, too. Thanks!