Re: [PATCH v2 0/2] Add strprefix() and fix a bug with it

From: Bartosz Golaszewski

Date: Thu Nov 05 2026 - 09:07:35 EST


On Thu, Nov 05, 2026 at 01:46:20PM +0100, Alejandro Colomar wrote:
> Hi!
>
> str_has_prefix() is based on sizes and lengths, which means it must
> overload the valid length 0 to mean not found. This is a typical
> consequence of choosing to design an API around sizes and lengths, and
> vanishes when moving to pointer-based similar APIs.
>
> This patch set adds strprefix(), deprecates str_has_prefix(), and uses
> strprefix() in one place to fix a bug reported by Bartosz.
>
> We can later work on replacing the other uses of str_has_prefix(), which
> might hide similar bugs.
>

I have no idea what causes it but I'm getting so many patches lately
that are subsequent iterations of a series sent with In-Reply-To: header
pointing to a previous thread.

Don't do this. Each new iteration must be a separate thread. Please use
b4 to manage patch series.

Bart