OSDN Git Service

getopt_long: accept prefix match of long options containing equals signs
authorSamuel Holland <samuel@sholland.org>
Tue, 30 Jan 2018 02:36:42 +0000 (20:36 -0600)
committerRich Felker <dalias@aerifal.cx>
Thu, 1 Feb 2018 03:04:50 +0000 (22:04 -0500)
commit6f03b61b46d238d480f5b7730ba906e172066e59
tree0f4c92a845b87e0c465eb8521b33074fd4de0210
parentf1abc29bd09dde14edd942f5868446aaba77f73f
getopt_long: accept prefix match of long options containing equals signs

Consider the first equals sign found in the option to be the delimiter
between it and its argument, even if it matches an equals sign in the
option name. This avoids consuming the equals sign, which would prevent
finding the argument. Instead, it forces a partial match of the part of
the option name before the equals sign.

Maintainer's note: GNU getopt_long does not explicitly document this
behavior, but it can be seen as a consequence of how partial matches
are specified, and at least GNU (bfd) ld is known to make use of it.
src/misc/getopt_long.c