2012-12-03 [colin] 3.9.0cvs38
authorColin Leroy <colin@colino.net>
Mon, 3 Dec 2012 09:34:16 +0000 (09:34 +0000)
committerColin Leroy <colin@colino.net>
Mon, 3 Dec 2012 09:34:16 +0000 (09:34 +0000)
* src/common/utils.c
Fix following relative symlinks

ChangeLog
PATCHSETS
configure.ac
src/common/utils.c

index 081b932548a7726cb8cea6022347176e23c9b008..1b416968365022f9dd2eb0943b2b0ec01905e7dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-12-03 [colin]     3.9.0cvs38
+
+       * src/common/utils.c
+               Fix following relative symlinks
+
 2012-12-02 [colin]     3.9.0cvs37
 
        * src/main.c
index 996788522912cc5144f1d3428ea30915f045dcbc..55e85e40680ca01235c2fc19f1a4d28bf3634f5e 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.36.2.210 -r 1.36.2.211 src/common/utils.c;  ) > 3.9.0cvs35.patchset
 ( cvs diff -u -r 1.115.2.265 -r 1.115.2.266 src/main.c;  ) > 3.9.0cvs36.patchset
 ( cvs diff -u -r 1.115.2.266 -r 1.115.2.267 src/main.c;  ) > 3.9.0cvs37.patchset
+( cvs diff -u -r 1.36.2.211 -r 1.36.2.212 src/common/utils.c;  ) > 3.9.0cvs38.patchset
index 1fcf12de0866da4fa3e733dd6e17bd20f53c338c..e0d5ef911889db1471e1fa5c47aa2e55a2e9620e 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=9
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=37
+EXTRA_VERSION=38
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 9ec5ed59813d78b45137cf765cf0aab5e74df683..a5936e0ee11f091a63c78e76a644d9d56e09a5cc 100644 (file)
@@ -1865,10 +1865,11 @@ static gboolean rc_dir_alt = FALSE;
 const gchar *get_rc_dir(void)
 {
 
-       if (!claws_rc_dir)
+       if (!claws_rc_dir) {
                claws_rc_dir = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S,
                                     RC_DIR, NULL);
-
+               debug_print("using default rc_dir %s\n", claws_rc_dir);
+       }
        return claws_rc_dir;
 }
 
@@ -1879,6 +1880,8 @@ void set_rc_dir(const gchar *dir)
                g_print("Error: rc_dir already set\n");
        } else {
                int err = cm_canonicalize_filename(dir, &canonical_dir);
+               int len;
+
                if (err) {
                        g_print("Error looking for %s: %d(%s)\n",
                                dir, -err, strerror(-err));
@@ -1888,6 +1891,10 @@ void set_rc_dir(const gchar *dir)
 
                claws_rc_dir = canonical_dir;
                
+               len = strlen(claws_rc_dir);
+               if (claws_rc_dir[len - 1] == G_DIR_SEPARATOR)
+                       claws_rc_dir[len - 1] = '\0';
+               
                debug_print("set rc_dir to %s\n", claws_rc_dir);
                if (!is_dir_exist(claws_rc_dir)) {
                        if (make_dir_hier(claws_rc_dir) != 0) {
@@ -5450,6 +5457,21 @@ static GSList *cm_split_path(const gchar *filename, int depth)
                                GError *error = NULL;
                                gchar *target = g_file_read_link(tmp_path, &error);
 
+                               if (!g_path_is_absolute(target)) {
+                                       /* remove the last inserted element */
+                                       canonical_parts = 
+                                               g_slist_delete_link(canonical_parts,
+                                                           canonical_parts);
+                                       /* add the target */
+                                       canonical_parts = g_slist_prepend(canonical_parts,
+                                               g_strdup(target));
+                                       g_free(target);
+
+                                       /* and get the new target */
+                                       target = canonical_list_to_file(canonical_parts);
+                               }
+
+                               /* restart from absolute target */
                                slist_free_strings_full(canonical_parts);
                                canonical_parts = NULL;
                                if (!error)