aboutsummaryrefslogtreecommitdiff
path: root/src/tool_operate.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-02-05 20:28:36 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-02-05 20:49:57 +0000
commitf8abd564502160d2c17e9eb71b00961059dd8aef (patch)
tree7542e8faceb4c2e14f2befa585ebc6dcb1b05a16 /src/tool_operate.c
parent61ba1daba01dfd959d68636b8d1785d00cdf65b4 (diff)
tool_operate: Moved .curlrc parsing code into operate()
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r--src/tool_operate.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index b180f067d..5a4afffc6 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -235,18 +235,6 @@ static int operate_do(struct Configurable *config, int argc,
** from outside of nested loops further down below.
*/
- /* Parse .curlrc if necessary */
- if((argc == 1) || (!curlx_strequal(argv[1], "-q"))) {
- parseconfig(NULL, config); /* ignore possible failure */
-
- /* If we had no arguments then make sure a url was specified in .curlrc */
- if((argc < 2) && (!config->url_list)) {
- helpf(config->errors, NULL);
- res = CURLE_FAILED_INIT;
- goto quit_curl;
- }
- }
-
/* Parse the command line arguments */
res = parse_args(config, argc, argv);
if(res) {
@@ -1856,8 +1844,20 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
if(result)
return result;
- /* Perform the main operation */
- result = operate_do(config, argc, argv);
+ /* Parse .curlrc if necessary */
+ if((argc == 1) || (!curlx_strequal(argv[1], "-q"))) {
+ parseconfig(NULL, config); /* ignore possible failure */
+
+ /* If we had no arguments then make sure a url was specified in .curlrc */
+ if((argc < 2) && (!config->url_list)) {
+ helpf(config->errors, NULL);
+ result = CURLE_FAILED_INIT;
+ }
+ }
+
+ if(!result)
+ /* Perform the main operation */
+ result = operate_do(config, argc, argv);
/* Perform the cleanup */
operate_free(config);