From ca22cbfab650ad9def1310f459d5003975a0912b Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 8 Nov 2019 18:16:42 -0500 Subject: Avoid calling getopt_long again after it returns -1 On GNU, calling getopt_long again will reset optind back to the first non-option argument, which would cause an infinite loop of reading the same configurtion file forever. --- config.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index a96cbb6..653ae16 100644 --- a/config.c +++ b/config.c @@ -42,7 +42,10 @@ int getopt_config( int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longindex ) { - int opt = getopt_long(argc, argv, optstring, longopts, longindex); + static int opt; + if (opt >= 0) { + opt = getopt_long(argc, argv, optstring, longopts, longindex); + } if (opt >= 0) return opt; for (;;) { -- cgit 1.4.1 > DON'T USE THIS! --- web frontend for git
about summary refs log tree commit diff
path: root/filters/syntax-highlighting.py (unfollow)
Commit message (Expand)Author
2018-09-11ui-log: ban strncpy()Christian Hesse
2018-09-11ui-log: ban strcpy()Christian Hesse
2018-09-11parsing: ban sprintf()Christian Hesse
2018-09-11parsing: ban strncpy()Christian Hesse
2018-08-28filters: generate anchor links from markdownChristian Hesse
2018-08-03Bump version.Jason A. Donenfeld
2018-08-03clone: fix directory traversalJason A. Donenfeld
2018-08-03config: record repo.snapshot-prefix in the per-repo configKonstantin Ryabitsev