• R
    always set optarg in getopt_long · e8e4e56a
    Rich Felker 提交于
    the standard getopt does not touch optarg unless processing an option
    with an argument. however, programs using the GNU getopt API, which we
    attempt to provide in getopt_long, expect optarg to be a null pointer
    after processing an option without an argument.
    
    before argument permutation support was added, such programs typically
    detected its absence and used their own replacement getopt_long,
    masking the discrepency in behavior.
    e8e4e56a
getopt_long.c 3.4 KB