1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Merge pull request #1498 from mwuttke97/send_file_remove_protocol

Remove "file://" from file names
This commit is contained in:
Michael Vetter 2021-03-10 09:34:42 +01:00 committed by GitHub
commit 0daa7f4a82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {