Re: [PATCH 3/3] test-parse-options: --expect=<string> option to simplify tests
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 6, 2016, 07:18 UTC
- Message-ID
- <xmqqwpn764ej.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAGZ79kZ59K5BoSVsbt4YM-Try9Q1CVdFeBW8GE5E1dJpSBWzVA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 6 quoted lines
>> + *colon = '\0'; >> + item = string_list_lookup(expect, buf.buf); >> + *colon = ':'; > > I have been staring at this for a good couple of minutes and wondered if this > low level string manipulation is really the best way to do it.
It just shows that string_list API was not designed as richly as others, compared to say the more complete API like strbuf. If it had a <ptr,len> variant, I wouldn't have needed the "temporary termination to get a string" hack.