From 8774301fb691d0e54ac19336db6217e1effbe587 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Mon, 18 Mar 2013 01:30:18 +0100 Subject: [PATCH] Added support for relative path for vimb. --- src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 0fa6b9c..a86e16d 100644 --- a/src/main.c +++ b/src/main.c @@ -137,6 +137,7 @@ gboolean vb_load_uri(Client* c, const Arg* arg) { char* uri; char* path = arg->s; + struct stat st; if (!path) { return FALSE; @@ -148,7 +149,7 @@ gboolean vb_load_uri(Client* c, const Arg* arg) } /* check if the path is a file path */ - if (path[0] == '/' || !strcspn(path, "./")) { + if (stat(path, &st) == 0) { char* rp = realpath(path, NULL); uri = g_strdup_printf("file://%s", rp); } else { -- 2.20.1