Skip to content

Commit

Permalink
Remove wget support, use libcurl by default
Browse files Browse the repository at this point in the history
  • Loading branch information
derf committed Feb 16, 2011
1 parent d634583 commit 77a5334
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 35 deletions.
29 changes: 0 additions & 29 deletions src/imlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ char *feh_http_load_image(char *url)
FILE *sfp;
int fd = -1;
char *ebuff;
char *ret;

curl = curl_easy_init();
if (!curl) {
Expand All @@ -463,7 +462,6 @@ char *feh_http_load_image(char *url)
if (sfp != NULL) {
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, sfp);
/* curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); */
ebuff = emalloc(CURL_ERROR_SIZE);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, ebuff);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
Expand Down Expand Up @@ -493,33 +491,6 @@ char *feh_http_load_image(char *url)
}
curl_easy_cleanup(curl);
return NULL;
} else {
int pid;
int status;

if ((pid = fork()) < 0) {
weprintf("open url: fork failed:");
free(tmpname);
return(NULL);
} else if (pid == 0) {
char *quiet = NULL;

if (!opt.verbose)
quiet = estrdup("-q");

execlp("wget", "wget", "--no-clobber", "--cache=off",
"-O", tmpname, url, quiet, NULL);
eprintf("url: Is 'wget' installed? Failed to exec wget:");
} else {
waitpid(pid, &status, 0);

if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
weprintf("url: wget failed to load URL %s\n", url);
unlink(tmpname);
free(tmpname);
return(NULL);
}
}
}

return(tmpname);
Expand Down
7 changes: 1 addition & 6 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ void init_parse_options(int argc, char **argv)
opt.jump_on_resort = 1;

opt.builtin_http = 0;
opt.libcurl_http = 0;

opt.xinerama = 0;
opt.screen_clip = 1;
Expand Down Expand Up @@ -326,7 +325,7 @@ static void feh_parse_option_array(int argc, char **argv)
{
static char stropts[] =
"a:A:b:B:cC:dD:e:E:f:Fg:GhH:iIj:J:kK:lL:mM:nNo:O:pPqQrR:sS:tT:uUvVwW:xXy:YzZ"
"0:1:2:4:5:8:9:.@:^:~:):|:+:{";
"0:1:2:4:5:8:9:.@:^:~:):|:+:";

/* (*name, has_arg, *flag, val) See: struct option in getopts.h */
static struct option lopts[] = {
Expand Down Expand Up @@ -357,7 +356,6 @@ static void feh_parse_option_array(int argc, char **argv)
{"reverse" , 0, 0, 'n'},
{"thumbnails" , 0, 0, 't'},
{"builtin" , 0, 0, 'Q'},
{"libcurl" , 0, 0, '{'},
{"scale-down" , 0, 0, '.'},
{"no-jump-on-resort", 0, 0, 220},
{"hide-pointer" , 0, 0, 'Y'},
Expand Down Expand Up @@ -475,9 +473,6 @@ static void feh_parse_option_array(int argc, char **argv)
case 'Q':
opt.builtin_http = 1;
break;
case '{':
opt.libcurl_http = 1;
break;
case 'L':
opt.customlist = estrdup(optarg);
opt.display = 0;
Expand Down

0 comments on commit 77a5334

Please sign in to comment.