Re: [PATCH 2/3] config: require at least one digit when parsing numbers
- From
Jeff King <peff@peff.net>
- Date
- Oct 22, 2022, 20:25 UTC
- Message-ID
- <Y1RRrK4/2vr/YPfz@coredump.intra.peff.net>
- In-Reply-To
- <xmqqilkbhhlw.fsf@gitster.g>
On Sat, Oct 22, 2022 at 10:51:23AM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> > This one is easier to test than the last. Just: > > > > git config --int --default='m' some.key > > > > works. And even playing devil's advocate, I can't think of a case where > > anybody would rely on the current behavior. > > Hmph, but --default=" m" would not be caught with the patch with the > same error, but is still a valid way to say zero mega unit.
I assumed that --default=" m" was supposed to be an error. It is already in the current code (because strtoimax doesn't skip the whitespace).
I admit I don't care much either way, though.
-Peff