Re: [PATCH v5 3/4] refs: allow reference location in refstorage config
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Feb 11, 2026, 10:27 UTC
- Message-ID
- <CAOLa=ZS00qJuRvDA0Ud34MiUAPuSMTe7M76fSWXmHmbPtc2wsw@mail.gmail.com>
- In-Reply-To
- <20260210224401.GA1836788@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 25 quoted lines
> On Mon, Feb 09, 2026 at 04:58:20PM +0100, Karthik Nayak wrote:
>
>> +static void parse_reference_uri(const char *value, char **format,
>> + char **payload)
>> +{
>> + char *schema_end;
>> +
>> + schema_end = strstr(value, "://");
>> + if (!schema_end) {
>> + *format = xstrdup(value);
>> + *payload = NULL;
>> + } else {
>> + *format = xstrndup(value, schema_end - value);
>> + *payload = xstrdup_or_null(schema_end + 3);
>> + }
>> +}
>
> The schema_end variable should be "const" here. Otherwise new versions
> of gcc/glibc will complain that the strstr() implicitly removes the
> const from value (and compilation with DEVELOPER=1 fails). More details
> in this thread:
>
> https://lore.kernel.org/git/e6f7e2eddbc9aef1c21f661420a4b8cb9cd8e2c1.1770095829.git.collin.funk1@gmail.com/
>
> -PeffThanks for the hint, my Linux distribution is still on glibc 2.42 and didn't see the error. Will fix it in my next version.