Re: git config set --file, key-value pair without '= value', gives Segmentation fault
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 1, 2024, 01:28 UTC
- Message-ID
- <xmqq1q39yqsy.fsf@gitster.g>
- In-Reply-To
- <ZqrKeG+alFldB7OY@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
> I tried to match the behavior a few lines down in that function, where > we only call regexec() if value is non-NULL.
Yes, that is exactly what made me question the code. With the current code, valueless true cannot be updated with "--value" restriction, ever, because it will never match anything.
In any case, the patch is a strict improvement over the current code that segfaults. Making it aware of "--type=bool" and have it treat synonymous values of true/false properly would be better left as a follow-up topic.
Thanks.