Skip to content

Commit

Permalink
Bug 797674 - 3.9: test-gnc-path-util failed on Debian amd64
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Apr 11, 2020
1 parent 6ac309a commit c91fb77
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions libgnucash/core-utils/binreloc.c
Expand Up @@ -469,23 +469,26 @@ gnc_gbr_find_prefix (const gchar *default_prefix)
static gchar*
find_component_directory (const gchar *default_dir, const gchar* compiled_dir)
{
gchar *prefix = NULL, *dir = NULL, *subdir = NULL;
gchar *prefix = NULL, *dir = NULL;
gchar *subdir = gnc_file_path_relative_part(PREFIX, compiled_dir);

prefix = gnc_gbr_find_prefix (NULL);
if (prefix == NULL)
return g_strdup (default_dir ? default_dir : compiled_dir);
else if (!g_strcmp0 (prefix, PREFIX))
return g_strdup (compiled_dir);

subdir = gnc_file_path_relative_part(PREFIX, compiled_dir);
if (g_strcmp0 (compiled_dir, subdir) == 0)
if (!g_getenv("GNC_UNINSTALLE"))
{
/* compiled_dir isn't a subdir of PREFIX. This isn't relocatable so
* return compiled_dir.
*/
g_free (subdir);
g_free (prefix);
return g_strdup (compiled_dir);
if (!g_strcmp0 (prefix, PREFIX))
return g_strdup (compiled_dir);

if (g_strcmp0 (compiled_dir, subdir) == 0)
{
/* compiled_dir isn't a subdir of PREFIX. This isn't relocatable so
* return compiled_dir.
*/
g_free (subdir);
g_free (prefix);
return g_strdup (compiled_dir);
}
}
dir = g_build_filename (prefix, subdir, NULL);
g_free (subdir);
Expand Down

0 comments on commit c91fb77

Please sign in to comment.