/* The returned file name was g_malloc()'d so it must be g_free()d when the caller is done with it.  */
char* get_persconffile_path(const char *filename, gboolean from_profile)
/* The returned file name was g_malloc()'d so it must be g_free()d when the caller is done with it.  */
char* get_persconffile_path(const char *filename, gboolean from_profile)
{
    char *path;
    if (do_store_persconffiles && from_profile && !g_hash_table_lookup (profile_files, filename)) {
        g_hash_table_insert (profile_files, g_strdup(filename), g_strdup(filename));
    }
    if (from_profile) {
      path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s",
                 get_persconffile_dir(persconfprofile), filename);
    } else {
      path = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s",
                 get_persconffile_dir(NULL), filename);
    }
    return path;
}