From 1576ac11cbfddd15e5e0e31e5dcb0df5d57c2b5c Mon Sep 17 00:00:00 2001 From: Maximilian Wuttke Date: Tue, 9 Mar 2021 20:45:29 +0100 Subject: Remove "file://" from file names Rationale: When copying an image in some application, a URL instead of a path is copied to the clipboard. --- src/common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common.c b/src/common.c index 75139676..6defa7c1 100644 --- a/src/common.c +++ b/src/common.c @@ -577,6 +577,9 @@ get_expanded_path(const char* path) GString* exp_path = g_string_new(""); gchar* result; + if (g_str_has_prefix(path, "file://")) { + path += strlen("file://"); + } if (strlen(path) >= 2 && path[0] == '~' && path[1] == '/') { g_string_printf(exp_path, "%s/%s", getenv("HOME"), path + 2); } else { -- cgit 1.4.1-2-gfad0