Edit

IABSD.fr/src/usr.bin/grep

Branch :

  • Show log

    Commit

  • Author : schwarze
    Date : 2025-05-09 00:50:29
    Hash : 9eae247a
    Message : POSIX requires in chapter 12.2, Utility Syntax Guideline 9: "All options should precede operands on the command line." https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap12.html#tag_1202 and grep(1) is explicitly required to conform right below OPTIONS: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/grep.html Consequently, that our grep(1) treated operands starting with dashes after other operands as options was a standard-violating bug. Fix this bug as documented for "optstring" in the getopt_long(3) manual. Issue reported by Petr Rockai <m dot v0adgys6 at fixp dot eu> on tech@. OK miod@ tedu@ espie@ tb@ and tested in a bulk build by tb@ with no fallout.