diff options
author | Steve Holme <steve_holme@hotmail.com> | 2014-02-23 15:30:24 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2014-02-24 21:25:36 +0000 |
commit | f35668985e050623e40428f0a142eecd97dc00f6 (patch) | |
tree | 284c07d08a42fca0351ca1af99fee54f76cd7db7 | |
parent | e904b15f21e5669fa04baa59611a1a523cdae4c9 (diff) |
tool_cfgable: Added support for knowing the current operation
-rw-r--r-- | src/tool_cfgable.h | 1 | ||||
-rw-r--r-- | src/tool_operate.c | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index 69c2c2ee9..78d17c7d3 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -224,6 +224,7 @@ struct GlobalConfig { CURL *easy; /* Once we have one, we keep it here */ struct OperationConfig *first; + struct OperationConfig *current; struct OperationConfig *last; /* Always last in the struct */ }; diff --git a/src/tool_operate.c b/src/tool_operate.c index 25aa9413d..6458c11a9 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -1831,14 +1831,14 @@ CURLcode operate(struct GlobalConfig *config, int argc, argv_item_t argv[]) operation = operation->next; } - /* Reset the operation pointer */ - operation = config->first; + /* Set the current operation pointer */ + config->current = config->first; /* Perform each operation */ - while(!result && operation) { - result = operate_do(operation); + while(!result && config->current) { + result = operate_do(config->current); - operation = operation->next; + config->current = config->current->next; } } } |