diff options
author | Steve Holme <steve_holme@hotmail.com> | 2014-02-23 16:04:39 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2014-02-25 19:38:17 +0000 |
commit | 0704dd770d545271ff11210e983a434a043738a7 (patch) | |
tree | bf9534d4e28993994a46964db6b75efa3d078de3 /src/tool_parsecfg.c | |
parent | ad388a7d37c7cd610155af84d4f88d1cf36e3f5b (diff) | |
download | curl-0704dd770d545271ff11210e983a434a043738a7.tar.gz |
tool_getparam: Added global config to getparameter()
In preparation for parsing global options added the GlobalConfig
structure to the getparameter() function.
Diffstat (limited to 'src/tool_parsecfg.c')
-rw-r--r-- | src/tool_parsecfg.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index 69bacbf18..da10c878f 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -44,7 +44,7 @@ static const char *unslashquote(const char *line, char *param); static char *my_get_line(FILE *fp); /* return 0 on everything-is-fine, and non-zero otherwise */ -int parseconfig(const char *filename, struct OperationConfig *config) +int parseconfig(const char *filename, struct GlobalConfig *global) { int res; FILE *file; @@ -52,6 +52,7 @@ int parseconfig(const char *filename, struct OperationConfig *config) bool usedarg; char *home; int rc = 0; + struct OperationConfig *operation = global->first; if(!filename || !*filename) { /* NULL or no file name attempts to load .curlrc from the homedir! */ @@ -201,8 +202,8 @@ int parseconfig(const char *filename, struct OperationConfig *config) case '#': /* comment */ break; default: - warnf(config, "%s:%d: warning: '%s' uses unquoted white space in the" - " line that may cause side-effects!\n", + warnf(operation, "%s:%d: warning: '%s' uses unquoted white space in" + " the line that may cause side-effects!\n", filename, lineno, option); } } @@ -218,7 +219,7 @@ int parseconfig(const char *filename, struct OperationConfig *config) #ifdef DEBUG_CONFIG fprintf(stderr, "PARAM: \"%s\"\n",(param ? param : "(null)")); #endif - res = getparameter(option, param, &usedarg, config); + res = getparameter(option, param, &usedarg, global, operation); if(param && *param && !usedarg) /* we passed in a parameter that wasn't used! */ @@ -234,7 +235,7 @@ int parseconfig(const char *filename, struct OperationConfig *config) res != PARAM_VERSION_INFO_REQUESTED && res != PARAM_ENGINES_REQUESTED) { const char *reason = param2text(res); - warnf(config, "%s:%d: warning: '%s' %s\n", + warnf(operation, "%s:%d: warning: '%s' %s\n", filename, lineno, option, reason); } } |