Re: [PATCH v6 02/19] string: Add strprefix()

From: Joe Perches

Date: Sat Nov 14 2026 - 10:28:54 EST


On Sat, 2026-11-14 at 16:22 +0100, Alejandro Colomar wrote:
> As Bartosz reported, str_has_prefix() has a bug: it can't differentiate
> between an empty prefix matching an empty string from a non-matching
> prefix. This is a fundamental design flaw in this API, and not
> something that can be fixed.

I still think this description is poor.
It's neither a bug nor a flaw.
It's a design choice.