From: D. Ben Knoble Date: Tue, 04 Nov 2025 18:22:26 GMT Subject: Re: [PATCH v2 3/3] parseopt: values of pathname type can be prefixed with :(optional) Message-ID: In-Reply-To: On Sun, Nov 2, 2025 at 7:10 PM Eric Sunshine wrote: > > On Sun, Nov 2, 2025 at 11:20 AM D. Ben Knoble > wrote: > > On Tue, Sep 30, 2025 at 11:26 AM Phillip Wood wrote: > > > On 28/09/2025 22:29, D. Ben Knoble wrote: > > > > + is_optional = skip_prefix(value, ":(optional)", &value); > > > > + if (!value) > > > > + is_optional = 0; > > > > > > I'm struggling to see how value can be NULL here as we return early if > > > it NULL before calling skip_prefix() > > > > Doesn't the "skip_prefix" above write into value? So I think if > > "value" is exactly the string ":(optional)", then after the call to > > skip_prefix it points at the null terminator. > > I haven't particularly been following this topic, but your response > suggests that you're reading the code as if it says: > > if (!*value) > is_optional = 0; > > whereas, Philip is reading the code as written, which lacks the `*` dereference. Indeed, thanks