mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Remove "file://" from file names
Rationale: When copying an image in some application, a URL instead of a path is copied to the clipboard.
This commit is contained in:
parent
a4ec8530a9
commit
1576ac11cb
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user