From 0c9745dfdac70e4d83a599fe0585ea4c6abe1471 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 10 May 2024 13:52:48 +0200 Subject: [PATCH] optind needs to be set to 0 than 1 optind needs to be set to 0 than 1 to reinit its internal state (see NOTES in man getopt(3)) for getopt_long() in hd-rum-transcode. If not so, the leading '+' in optstring (== disallowing permutation) won't be effective. --- src/host.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/host.cpp b/src/host.cpp index 4e39c8035..effeacf78 100644 --- a/src/host.cpp +++ b/src/host.cpp @@ -371,6 +371,7 @@ static bool parse_opts_set_logging(int argc, char *argv[]) } optind = 1; } + optind = 0; opterr = saved_opterr; if (logging_lvl == 0) { logging_lvl = getenv("ULTRAGRID_VERBOSE") != nullptr && strlen(getenv("ULTRAGRID_VERBOSE")) > 0 ? LOG_LEVEL_VERBOSE : log_level;