Skip to content

getopt parsing broken on glibc #5

Description

@perennialmind

Since IP addresses/ranges are excluded with the same character as standard
options (dash, '-'), GNU getopt(3) will erroneously interpret these as invalid
options, unless the user sets the POSIXLY_CORRECT environment variable.
Specifying a '+' prefix ensures that these will be treated as regular
arguments.

With POSIX getopt, option arguments may or may not be in separate argv[] elements.
If the user bundles the option argument, such as -p/run/choparp.pid, the option
parsing code in main() would skip over the first non-option argument.

Fixed in patch 07-getopt-parsing as seen here:
perennialmind@1b9002d

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions