diff options
author | Rici Lake <ricilake@gmail.com> | 2020-03-18 18:28:19 -0500 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-03-20 11:14:12 +0100 |
commit | 4e0b4fee4aea25da850327e068f307e6dc5200f2 (patch) | |
tree | 21bd0dfce7e4dd3ff443091737d006601f82b1ec /src/tool_parsecfg.c | |
parent | 3d77d089a4abaf81f4be4b78f66c4356002de3e3 (diff) | |
download | curl-4e0b4fee4aea25da850327e068f307e6dc5200f2.tar.gz |
cmdline: fix handling of OperationConfig linked list (--next)
Ensures that -K/--config inserts new items at the end of the list
instead of overwriting the second item, and that after a -K/--config
option has been parsed, the option parser's view of the current config
is update.
Fixes #5120
Closes #5123
Diffstat (limited to 'src/tool_parsecfg.c')
-rw-r--r-- | src/tool_parsecfg.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index a9057ea31..efb9159e7 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -76,7 +76,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global) FILE *file = NULL; bool usedarg = FALSE; int rc = 0; - struct OperationConfig *operation = global->first; + struct OperationConfig *operation = global->last; char *pathalloc = NULL; if(!filename || !*filename) { @@ -233,6 +233,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global) fprintf(stderr, "PARAM: \"%s\"\n",(param ? param : "(null)")); #endif res = getparameter(option, param, &usedarg, global, operation); + operation = global->last; if(!res && param && *param && !usedarg) /* we passed in a parameter that wasn't used! */ |