[epiphany] file-helpers: convert profile_dir to absolute path



commit 27fdc93acaf11f7709fccbce40a6fd6756177e95
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri Feb 26 21:05:41 2016 -0600

    file-helpers: convert profile_dir to absolute path
    
    When Epiphany is run with --profile and a relative path to the profile
    dir, it mostly works fine, with the exception of a bunch of criticals
    coming from EphyUriTester. Fix it here so the rest of the code doesn't
    have to worry about relative paths.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762762

 lib/ephy-file-helpers.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index de07084..1c828cf 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -330,7 +330,16 @@ ephy_file_helpers_init (const char *profile_dir,
 
        if (profile_dir != NULL && !steal_data_from_profile)
        {
-               dot_dir = g_strdup (profile_dir);
+               if (g_path_is_absolute (profile_dir))
+               {
+                       dot_dir = g_strdup (profile_dir);
+               }
+               else
+               {
+                       GFile *file = g_file_new_for_path (profile_dir);
+                       dot_dir = g_file_get_path (file);
+                       g_object_unref (file);
+               }
        }
        else if (private_profile)
        {
@@ -348,7 +357,8 @@ ephy_file_helpers_init (const char *profile_dir,
                                            "epiphany",
                                            NULL);
        }
-       else
+
+       if (dot_dir == NULL)
        {
                dot_dir = ephy_default_dot_dir ();
                is_default_dot_dir = TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]