diff options
-rw-r--r-- | src/app-indicator.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/app-indicator.c b/src/app-indicator.c index a73e9a4..875c0b1 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -2066,6 +2066,7 @@ get_snap_prefix () static gchar * append_snap_prefix (const gchar *path) { + gint i; gchar real_path[PATH_MAX]; const gchar *snap = get_snap_prefix (); @@ -2079,10 +2080,21 @@ append_snap_prefix (const gchar *path) return NULL; } - if (g_str_has_prefix (path, snap)) { + if (g_str_has_prefix (path, snap) || + g_str_has_prefix (path, g_get_home_dir ()) || + g_str_has_prefix (path, g_get_user_cache_dir ()) || + g_str_has_prefix (path, g_get_user_config_dir ()) || + g_str_has_prefix (path, g_get_user_data_dir ()) || + g_str_has_prefix (path, g_get_user_runtime_dir ())) { return g_strdup (path); } + for (i = 0; i < G_USER_N_DIRECTORIES; ++ i) { + if (g_str_has_prefix (path, g_get_user_special_dir (i))) { + return g_strdup (path); + } + } + return g_build_path (G_DIR_SEPARATOR_S, snap, path, NULL); } |