"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: regress/tog: enable in sha256 mode
To:
Mark Jamsek <mark@jamsek.com>
Cc:
Christian Weisgerber <naddy@mips.inka.de>, gameoftrees@openbsd.org
Date:
Wed, 7 Aug 2024 13:04:16 +0200

Download raw body.

Thread
On Wed, Aug 07, 2024 at 08:58:47PM +1000, Mark Jamsek wrote:
> Christian Weisgerber <naddy@mips.inka.de> 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!