summaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-04-14 16:28:51 +0200
committerDaniel Friesel <derf@finalrewind.org>2014-04-14 16:28:51 +0200
commitece02b618b414244ef8247bd727e30e664249f77 (patch)
tree1df8fda0e149afad66f131cddbbe5077589b123b /src/utils.c
parentad285742e9f2111e4ae3d05deb41bfebbce58025 (diff)
Use new path_is_url helper instead of repeated strncmp chains
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 037010e..bd189d3 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -143,6 +143,15 @@ char *estrjoin(const char *separator, ...)
return string;
}
+char path_is_url(char *path) {
+ if ((!strncmp(path, "http://", 7))
+ || (!strncmp(path, "https://", 8))
+ || (!strncmp(path, "ftp://", 6))
+ || (!strncmp(path, "file://", 7)))
+ return 1;
+ return 0;
+}
+
/* free the result please */
char *feh_unique_filename(char *path, char *basename)
{