From f35668985e050623e40428f0a142eecd97dc00f6 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sun, 23 Feb 2014 15:30:24 +0000 Subject: [PATCH] tool_cfgable: Added support for knowing the current operation --- src/tool_cfgable.h | 1 + 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; } } }