mirror of
https://github.com/moparisthebest/curl
synced 2025-01-08 12:28:06 -05:00
tool_operate: Moved initial config setup into new init_config() function
This commit is contained in:
parent
83dbd06936
commit
9ab0dc618f
@ -22,6 +22,7 @@
|
|||||||
#include "tool_setup.h"
|
#include "tool_setup.h"
|
||||||
|
|
||||||
#include "tool_cfgable.h"
|
#include "tool_cfgable.h"
|
||||||
|
#include "tool_main.h"
|
||||||
|
|
||||||
#include "memdebug.h" /* keep this as LAST include */
|
#include "memdebug.h" /* keep this as LAST include */
|
||||||
|
|
||||||
@ -30,6 +31,16 @@ void init_config(struct Configurable* config)
|
|||||||
memset(config, 0, sizeof(struct Configurable));
|
memset(config, 0, sizeof(struct Configurable));
|
||||||
|
|
||||||
config->errors = stderr; /* default errors to stderr */
|
config->errors = stderr; /* default errors to stderr */
|
||||||
|
config->postfieldsize = -1;
|
||||||
|
config->showerror = -1; /* will show errors */
|
||||||
|
config->use_httpget = FALSE;
|
||||||
|
config->create_dirs = FALSE;
|
||||||
|
config->maxredirs = DEFAULT_MAXREDIRS;
|
||||||
|
config->proto = CURLPROTO_ALL; /* FIXME: better to read from library */
|
||||||
|
config->proto_present = FALSE;
|
||||||
|
config->proto_redir =
|
||||||
|
CURLPROTO_ALL & ~(CURLPROTO_FILE|CURLPROTO_SCP); /* not FILE or SCP */
|
||||||
|
config->proto_redir_present = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_config_fields(struct Configurable *config)
|
void free_config_fields(struct Configurable *config)
|
||||||
|
@ -253,18 +253,6 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
|
|||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* inits */
|
|
||||||
config->postfieldsize = -1;
|
|
||||||
config->showerror = -1; /* will show errors */
|
|
||||||
config->use_httpget = FALSE;
|
|
||||||
config->create_dirs = FALSE;
|
|
||||||
config->maxredirs = DEFAULT_MAXREDIRS;
|
|
||||||
config->proto = CURLPROTO_ALL; /* FIXME: better to read from library */
|
|
||||||
config->proto_present = FALSE;
|
|
||||||
config->proto_redir =
|
|
||||||
CURLPROTO_ALL & ~(CURLPROTO_FILE|CURLPROTO_SCP); /* not FILE or SCP */
|
|
||||||
config->proto_redir_present = FALSE;
|
|
||||||
|
|
||||||
if((argc > 1) &&
|
if((argc > 1) &&
|
||||||
(!curlx_strnequal("--", argv[1], 2) && (argv[1][0] == '-')) &&
|
(!curlx_strnequal("--", argv[1], 2) && (argv[1][0] == '-')) &&
|
||||||
strchr(argv[1], 'q')) {
|
strchr(argv[1], 'q')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user