Fix reading/writing linked files

"base" was not really base but the filename :-)

Fix https://github.com/profanity-im/profanity/issues/1362
This commit is contained in:
Michael Vetter
2020-06-13 15:02:43 +02:00
parent 74e061165a
commit 914c6752dd
5 changed files with 5 additions and 4 deletions

View File

@@ -307,6 +307,7 @@ get_file_or_linked(char *loc, char *basedir)
// if relative, add basedir
if (!g_str_has_prefix(true_loc, "/") && !g_str_has_prefix(true_loc, "~")) {
GString *base_str = g_string_new(basedir);
g_string_append(base_str, "/");
g_string_append(base_str, true_loc);
free(true_loc);
true_loc = base_str->str;