> My interpretation of the linked thread was that "starts with" is
> supposed to mean a strict prefix in POSIX, so "-" doesn't start with
> "-".  I haven't found anything in the standard that says that
> explicitly though.  If you'd rather interpret "starts with" to include
> exact matches, feel free to drop this patch.

Actually I think you're right.
I mixed the case of "-" and "!", "[()]".

The distinction seems to be explicitely made between “starts with” and
“is”:

“starts with a '-', or is a '!' or a '('”

And I misread the savannah PR example too.

So in fine, I agree with the patch!

Although,

> +     return !(arg[0] == '-' && arg[1]) && strcmp(arg, "!") && strcmp(arg, 
> "(");

Having a negation operator at the start of an expression which does
not negate the whole expression chain is kind of misleading.

Why not:

return strcmp(arg, "-") || && strcmp(arg, "!") && strcmp(arg, "(");

Reply via email to