aboutsummaryrefslogtreecommitdiff
path: root/src/tool_parsecfg.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-02-23 18:01:36 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-02-26 22:05:37 +0000
commitfc59a9e18f21c8dc95ead90ef67946f18d555087 (patch)
treee791af0bda7a20a92f14dbc3e3cbe6db833ee81c /src/tool_parsecfg.c
parent07d7603b458db6a2a818532661e931093906ac2b (diff)
tool: Added support to .curlrc for URL specific options
In addition to adding support for URL specific options via the command line with --next it is now possible to specify "next" in .curlrc.
Diffstat (limited to 'src/tool_parsecfg.c')
-rw-r--r--src/tool_parsecfg.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c
index da10c878f..9adbe8229 100644
--- a/src/tool_parsecfg.c
+++ b/src/tool_parsecfg.c
@@ -225,7 +225,29 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
/* we passed in a parameter that wasn't used! */
res = PARAM_GOT_EXTRA_PARAMETER;
- if(res != PARAM_OK) {
+ if(res == PARAM_NEXT_OPERATION) {
+ if(operation->url_list && operation->url_list->url) {
+ /* Allocate the next config */
+ operation->next = malloc(sizeof(struct OperationConfig));
+ if(operation->next) {
+ /* Initialise the newly created config */
+ config_init(operation->next);
+
+ /* Copy the easy handle */
+ operation->next->easy = global->easy;
+
+ /* Update the last operation pointer */
+ global->last = operation->next;
+
+ /* Move onto the new config */
+ operation->next->prev = operation;
+ operation = operation->next;
+ }
+ else
+ res = PARAM_NO_MEM;
+ }
+ }
+ else if(res != PARAM_OK) {
/* the help request isn't really an error */
if(!strcmp(filename, "-")) {
filename = (char *)"<stdin>";