openbsd-ports/graphics/feh/patches/patch-src_imlib_c
2010-10-15 12:52:23 +00:00

50 lines
1.5 KiB
Plaintext

$OpenBSD: patch-src_imlib_c,v 1.3 2010/10/15 12:52:23 dcoppa Exp $
--- src/imlib.c.orig Thu Oct 7 20:28:39 2010
+++ src/imlib.c Fri Oct 15 14:47:36 2010
@@ -438,6 +438,7 @@ char *feh_http_load_image(char *url)
close(sockno);
fclose(fp);
} else {
+ int fd;
int pid;
int status;
@@ -446,18 +447,20 @@ char *feh_http_load_image(char *url)
free(tmpname);
return(NULL);
} else if (pid == 0) {
- char *quiet = NULL;
-
- if (!opt.verbose)
- quiet = estrdup("-q");
-
- execlp("wget", "wget", "--cache=off", "-O", tmpname, url, quiet, NULL);
- eprintf("url: Is 'wget' installed? Failed to exec wget:");
+ if (!opt.verbose) {
+ if ((fd = open("/dev/null", O_WRONLY)) != -1) {
+ dup2(fd, fileno(stdout));
+ dup2(fd, fileno(stderr));
+ }
+ if (fd > 2) close(fd);
+ }
+ execlp("ftp", "ftp", "-o", tmpname, url, (char *)NULL);
+ eprintf("url: Is 'ftp' installed? Failed to exec ftp:");
} else {
waitpid(pid, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
- weprintf("url: wget failed to load URL %s\n", url);
+ weprintf("url: ftp failed to load URL %s\n", url);
unlink(tmpname);
free(tmpname);
return(NULL);
@@ -1038,7 +1041,7 @@ void feh_edit_inplace_lossless_rotate(winwidget w, int
} else if (pid == 0) {
execlp("jpegtran", "jpegtran", "-copy", "all", "-rotate",
- rotate_str, "-outfile", file_str, file_str, NULL);
+ rotate_str, "-outfile", file_str, file_str, (char *)NULL);
eprintf("lossless rotate: Is 'jpegtran' installed? Failed to exec:");
} else {