1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-10 11:35:07 -05:00

tool: remove redundant libcurl check

The easysrc generation is run only when --libcurl is initialized.

Ref: https://github.com/bagder/curl/issues/429

Closes #448
This commit is contained in:
Daniel Hwang 2015-09-21 21:06:42 -07:00 committed by Daniel Stenberg
parent 0583ed3e48
commit 1467dec147

View File

@ -172,55 +172,53 @@ void dumpeasysrc(struct GlobalConfig *config)
struct curl_slist *ptr; struct curl_slist *ptr;
char *o = config->libcurl; char *o = config->libcurl;
if(o) { FILE *out;
FILE *out; bool fopened = FALSE;
bool fopened = FALSE; if(strcmp(o, "-")) {
if(strcmp(o, "-")) { out = fopen(o, FOPEN_WRITETEXT);
out = fopen(o, FOPEN_WRITETEXT); fopened = TRUE;
fopened = TRUE; }
} else
else out = stdout;
out = stdout; if(!out)
if(!out) warnf(config, "Failed to open %s to write libcurl code!\n", o);
warnf(config, "Failed to open %s to write libcurl code!\n", o); else {
else { int i;
int i; const char *c;
const char *c;
for(i=0; ((c = srchead[i]) != NULL); i++) for(i=0; ((c = srchead[i]) != NULL); i++)
fprintf(out, "%s\n", c); fprintf(out, "%s\n", c);
/* Declare variables used for complex setopt values */ /* Declare variables used for complex setopt values */
for(ptr=easysrc_decl; ptr; ptr = ptr->next) for(ptr=easysrc_decl; ptr; ptr = ptr->next)
fprintf(out, " %s\n", ptr->data); fprintf(out, " %s\n", ptr->data);
/* Set up complex values for setopt calls */
if(easysrc_data) {
fprintf(out, "\n");
for(ptr=easysrc_data; ptr; ptr = ptr->next)
fprintf(out, " %s\n", ptr->data);
}
/* Set up complex values for setopt calls */
if(easysrc_data) {
fprintf(out, "\n"); fprintf(out, "\n");
for(ptr=easysrc_code; ptr; ptr = ptr->next) {
if(ptr->data[0]) {
fprintf(out, " %s\n", ptr->data);
}
else {
fprintf(out, "\n");
}
}
for(ptr=easysrc_clean; ptr; ptr = ptr->next) for(ptr=easysrc_data; ptr; ptr = ptr->next)
fprintf(out, " %s\n", ptr->data); fprintf(out, " %s\n", ptr->data);
for(i=0; ((c = srcend[i]) != NULL); i++)
fprintf(out, "%s\n", c);
if(fopened)
fclose(out);
} }
fprintf(out, "\n");
for(ptr=easysrc_code; ptr; ptr = ptr->next) {
if(ptr->data[0]) {
fprintf(out, " %s\n", ptr->data);
}
else {
fprintf(out, "\n");
}
}
for(ptr=easysrc_clean; ptr; ptr = ptr->next)
fprintf(out, " %s\n", ptr->data);
for(i=0; ((c = srcend[i]) != NULL); i++)
fprintf(out, "%s\n", c);
if(fopened)
fclose(out);
} }
easysrc_free(); easysrc_free();