client: fix parsing of -v command option
The sources and sourcestats commands accept -v as an option, but the glibc implementation of getopt() reorders the arguments and parses the option as a command-line option of chronyc. Add '+' to the getopt string to disable this feature. Other getopt() implementations should consider it a new command-line option, which will be handled as an error if present.
This commit is contained in:
parent
1c51feb3c5
commit
93076e7e1c
1 changed files with 1 additions and 1 deletions
2
client.c
2
client.c
|
@ -3143,7 +3143,7 @@ main(int argc, char **argv)
|
|||
optind = 1;
|
||||
|
||||
/* Parse short command-line options */
|
||||
while ((opt = getopt(argc, argv, "46acdf:h:mnp:v")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "+46acdf:h:mnp:v")) != -1) {
|
||||
switch (opt) {
|
||||
case '4':
|
||||
case '6':
|
||||
|
|
Loading…
Reference in a new issue