summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-12-03 15:39:45 +0100
committerDaniel Friesel <derf@finalrewind.org>2013-12-03 15:40:23 +0100
commit23a2aa5be6f97b4cf8bd2f5c7dad3def8ce970ef (patch)
tree13a9d8bfb4365888a21887611686f2b5c6c095bc
parent865a78510ff53db952ec5de98c934b60bfc664c8 (diff)
pass (potentially URL-encoded) file:// URLs to curl
This means it will be treated like an HTTP image (no write operations, copying to /tmp etc), but it's still better than no file:// support. Also, this is why it's not documented yet.
-rw-r--r--src/filelist.c3
-rw-r--r--src/imlib.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/filelist.c b/src/filelist.c
index bbde98c..8d19e41 100644
--- a/src/filelist.c
+++ b/src/filelist.c
@@ -213,7 +213,8 @@ void add_file_to_filelist_recursively(char *origpath, unsigned char level)
if ((!strncmp(path, "http://", 7))
|| (!strncmp(path, "https://", 8))
- || (!strncmp(path, "ftp://", 6))) {
+ || (!strncmp(path, "ftp://", 6))
+ || (!strncmp(path, "file://", 7))) {
/* Its a url */
D(("Adding url %s to filelist\n", path));
filelist = gib_list_add_front(filelist, feh_file_new(path));
diff --git a/src/imlib.c b/src/imlib.c
index 2047c63..36de346 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -243,8 +243,10 @@ int feh_load_image(Imlib_Image * im, feh_file * file)
return 0;
/* Handle URLs */
- if ((!strncmp(file->filename, "http://", 7)) || (!strncmp(file->filename, "https://", 8))
- || (!strncmp(file->filename, "ftp://", 6))) {
+ if ((!strncmp(file->filename, "http://", 7))
+ || (!strncmp(file->filename, "https://", 8))
+ || (!strncmp(file->filename, "ftp://", 6))
+ || (!strncmp(file->filename, "file://", 7))) {
image_source = SRC_HTTP;
if ((tmpname = feh_http_load_image(file->filename)) == NULL)