提交 6f0259a4 编写于 作者: R Rich Felker

fix bug whereby getopt_long allowed mismatch in last char of option name

上级 45a32199
......@@ -14,7 +14,7 @@ static int __getopt_long(int argc, char *const *argv, const char *optstring, con
const char *name = longopts[i].name;
char *opt = argv[optind]+1;
if (*opt == '-') opt++;
while (*name && *name++ == *opt++);
for (; *name && *name == *opt; name++, opt++);
if (*name || (*opt && *opt != '=')) continue;
if (*opt == '=') {
if (!longopts[i].has_arg) continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册