parent
d6b5d9f4ae
commit
2ed0e1f70e
@ -660,6 +660,7 @@ static ParameterError data_urlencode(struct GlobalConfig *global,
|
|||||||
|
|
||||||
ParameterError getparameter(const char *flag, /* f or -long-flag */
|
ParameterError getparameter(const char *flag, /* f or -long-flag */
|
||||||
char *nextarg, /* NULL if unset */
|
char *nextarg, /* NULL if unset */
|
||||||
|
argv_item_t cleararg,
|
||||||
bool *usedarg, /* set to TRUE if the arg
|
bool *usedarg, /* set to TRUE if the arg
|
||||||
has been used */
|
has been used */
|
||||||
struct GlobalConfig *global,
|
struct GlobalConfig *global,
|
||||||
@ -764,15 +765,16 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||||||
/* this option requires an extra parameter */
|
/* this option requires an extra parameter */
|
||||||
if(!longopt && parse[1]) {
|
if(!longopt && parse[1]) {
|
||||||
nextarg = (char *)&parse[1]; /* this is the actual extra parameter */
|
nextarg = (char *)&parse[1]; /* this is the actual extra parameter */
|
||||||
#ifdef HAVE_WRITABLE_ARGV
|
|
||||||
clearthis = nextarg;
|
|
||||||
#endif
|
|
||||||
singleopt = TRUE; /* don't loop anymore after this */
|
singleopt = TRUE; /* don't loop anymore after this */
|
||||||
}
|
}
|
||||||
else if(!nextarg)
|
else if(!nextarg)
|
||||||
return PARAM_REQUIRES_PARAMETER;
|
return PARAM_REQUIRES_PARAMETER;
|
||||||
else
|
else {
|
||||||
|
#ifdef HAVE_WRITABLE_ARGV
|
||||||
|
clearthis = cleararg;
|
||||||
|
#endif
|
||||||
*usedarg = TRUE; /* mark it as used */
|
*usedarg = TRUE; /* mark it as used */
|
||||||
|
}
|
||||||
|
|
||||||
if((aliases[hit].desc == ARG_FILENAME) &&
|
if((aliases[hit].desc == ARG_FILENAME) &&
|
||||||
(nextarg[0] == '-') && nextarg[1]) {
|
(nextarg[0] == '-') && nextarg[1]) {
|
||||||
@ -2494,7 +2496,7 @@ ParameterError parse_args(struct GlobalConfig *global, int argc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = getparameter(orig_opt, nextarg, &passarg,
|
result = getparameter(orig_opt, nextarg, argv[i + 1], &passarg,
|
||||||
global, config);
|
global, config);
|
||||||
|
|
||||||
curlx_unicodefree(nextarg);
|
curlx_unicodefree(nextarg);
|
||||||
@ -2533,7 +2535,7 @@ ParameterError parse_args(struct GlobalConfig *global, int argc,
|
|||||||
bool used;
|
bool used;
|
||||||
|
|
||||||
/* Just add the URL please */
|
/* Just add the URL please */
|
||||||
result = getparameter("--url", orig_opt, &used, global, config);
|
result = getparameter("--url", orig_opt, argv[i], &used, global, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!result)
|
if(!result)
|
||||||
|
|||||||
@ -55,6 +55,7 @@ struct GlobalConfig;
|
|||||||
struct OperationConfig;
|
struct OperationConfig;
|
||||||
|
|
||||||
ParameterError getparameter(const char *flag, char *nextarg,
|
ParameterError getparameter(const char *flag, char *nextarg,
|
||||||
|
argv_item_t cleararg,
|
||||||
bool *usedarg,
|
bool *usedarg,
|
||||||
struct GlobalConfig *global,
|
struct GlobalConfig *global,
|
||||||
struct OperationConfig *operation);
|
struct OperationConfig *operation);
|
||||||
|
|||||||
@ -223,7 +223,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
|
|||||||
#ifdef DEBUG_CONFIG
|
#ifdef DEBUG_CONFIG
|
||||||
fprintf(stderr, "PARAM: \"%s\"\n",(param ? param : "(null)"));
|
fprintf(stderr, "PARAM: \"%s\"\n",(param ? param : "(null)"));
|
||||||
#endif
|
#endif
|
||||||
res = getparameter(option, param, &usedarg, global, operation);
|
res = getparameter(option, param, NULL, &usedarg, global, operation);
|
||||||
operation = global->last;
|
operation = global->last;
|
||||||
|
|
||||||
if(!res && param && *param && !usedarg)
|
if(!res && param && *param && !usedarg)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user