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

From:
Mark Jamsek <mark@jamsek.com>
Subject:
Re: regress/tog: enable in sha256 mode
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Wed, 07 Aug 2024 20:58:47 +1000

Download raw body.

Thread
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

-- 
Mark Jamsek <https://bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68