aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-02-02 14:29:54 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-02-03 16:16:17 +0000
commit8034b08e0e49b21ab8b186575d638dee8c7dfb17 (patch)
tree00e294249186ca99fd37a887ccec359206cce2e4 /src
parentb811200f647ba465e3e43ab7bdb42aa0fa671c98 (diff)
tool_operate: Simplified parse .curlrc decision logic
Diffstat (limited to 'src')
-rw-r--r--src/tool_operate.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index ce7bceea6..76ffcd0da 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -239,23 +239,16 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
setlocale(LC_ALL, "");
#endif
- if((argc > 1) &&
- (!curlx_strnequal("--", argv[1], 2) && (argv[1][0] == '-')) &&
- strchr(argv[1], 'q')) {
- /*
- * The first flag, that is not a verbose name, but a shortname
- * and it includes the 'q' flag!
- */
- ;
- }
- else {
+ /* Parse .curlrc if necessary */
+ if((argc == 1) || (!curlx_strequal(argv[1], "-q"))) {
parseconfig(NULL, config); /* ignore possible failure */
- }
- if((argc < 2) && !config->url_list) {
- helpf(config->errors, NULL);
- res = CURLE_FAILED_INIT;
- goto quit_curl;
+ /* 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 options */