mirror of
https://github.com/curl/curl.git
synced 2026-08-26 05:33:38 +03:00
Improve code readbility
... by removing the else branch after a return, break or continue. Closes #1310
This commit is contained in:
parent
db87bcfcf2
commit
66de563482
37 changed files with 405 additions and 496 deletions
|
|
@ -783,11 +783,10 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||
|
||||
if(!url)
|
||||
return PARAM_NO_MEM;
|
||||
else {
|
||||
/* fill in the URL */
|
||||
GetStr(&url->url, nextarg);
|
||||
url->flags |= GETOUT_URL;
|
||||
}
|
||||
|
||||
/* fill in the URL */
|
||||
GetStr(&url->url, nextarg);
|
||||
url->flags |= GETOUT_URL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -878,7 +877,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||
&config->localportrange);
|
||||
if(!rc)
|
||||
return PARAM_BAD_USE;
|
||||
else if(rc == 1)
|
||||
if(rc == 1)
|
||||
config->localportrange = 1; /* default number of ports to try */
|
||||
else {
|
||||
config->localportrange -= config->localport;
|
||||
|
|
@ -1728,21 +1727,20 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||
|
||||
if(!url)
|
||||
return PARAM_NO_MEM;
|
||||
else {
|
||||
/* fill in the outfile */
|
||||
if('o' == letter) {
|
||||
GetStr(&url->outfile, nextarg);
|
||||
url->flags &= ~GETOUT_USEREMOTE; /* switch off */
|
||||
}
|
||||
else {
|
||||
url->outfile = NULL; /* leave it */
|
||||
if(toggle)
|
||||
url->flags |= GETOUT_USEREMOTE; /* switch on */
|
||||
else
|
||||
url->flags &= ~GETOUT_USEREMOTE; /* switch off */
|
||||
}
|
||||
url->flags |= GETOUT_OUTFILE;
|
||||
|
||||
/* fill in the outfile */
|
||||
if('o' == letter) {
|
||||
GetStr(&url->outfile, nextarg);
|
||||
url->flags &= ~GETOUT_USEREMOTE; /* switch off */
|
||||
}
|
||||
else {
|
||||
url->outfile = NULL; /* leave it */
|
||||
if(toggle)
|
||||
url->flags |= GETOUT_USEREMOTE; /* switch on */
|
||||
else
|
||||
url->flags &= ~GETOUT_USEREMOTE; /* switch off */
|
||||
}
|
||||
url->flags |= GETOUT_OUTFILE;
|
||||
}
|
||||
break;
|
||||
case 'P':
|
||||
|
|
@ -1867,14 +1865,13 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||
|
||||
if(!url)
|
||||
return PARAM_NO_MEM;
|
||||
|
||||
url->flags |= GETOUT_UPLOAD; /* mark -T used */
|
||||
if(!*nextarg)
|
||||
url->flags |= GETOUT_NOUPLOAD;
|
||||
else {
|
||||
url->flags |= GETOUT_UPLOAD; /* mark -T used */
|
||||
if(!*nextarg)
|
||||
url->flags |= GETOUT_NOUPLOAD;
|
||||
else {
|
||||
/* "-" equals stdin, but keep the string around for now */
|
||||
GetStr(&url->infile, nextarg);
|
||||
}
|
||||
/* "-" equals stdin, but keep the string around for now */
|
||||
GetStr(&url->infile, nextarg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue