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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: teach got patch how to strip
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Thu, 7 Apr 2022 12:37:15 +0200

Download raw body.

Thread
On Thu, Apr 07, 2022 at 12:15:44PM +0200, Omar Polo wrote:
> Stefan Sperling <stsp@stsp.name> wrote:
> > Small follow-up tweak: Variable 'p' in got_path_strip() is redundant.
> > ok?
> 
> oh, right, yes please!
> 
> needs a tweak to the patch.sh too thought:
> 
> -got: can't strip 1 path-components from foo/bar/alpha: bad path
> +got: can't strip 1 path-components from alpha: bad path

Ah sorry, no. My patch is wrong.
The error message should of course display the full path.

I missed that the 'path' variable is changed in the loop.

> also, i've only noticed it now, do we want to pluralize `components'
> only when n != 1?  I think i've seen something to handle pluralization
> already somewhere in got, not sure.

Not worth the effort in error messages, in my opinion.