[Xfce4-commits] [apps/xfce4-terminal] 01/01: Support terminalrc file being a symlink

noreply at xfce.org noreply at xfce.org
Mon Sep 17 18:17:38 CEST 2018


This is an automated email from the git hooks/post-receive script.

f   2   4   0   4       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-terminal.

commit 2151dfa38f538354237bb643f2f92136ae6ea1ec
Author: Igor <f2404 at yandex.ru>
Date:   Mon Sep 17 12:16:04 2018 -0400

    Support terminalrc file being a symlink
    
    This allows to monitor terminalrc file for changes even if it's a symlink.
    
    See bug #14698
---
 terminal/terminal-preferences.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index 9f29a7a..3d01ebd 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -31,6 +31,9 @@
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 #include <terminal/terminal-enum-types.h>
 #include <terminal/terminal-preferences.h>
@@ -1671,6 +1674,11 @@ terminal_preferences_monitor_connect (TerminalPreferences *preferences,
   GError    *error = NULL;
   GFileInfo *info;
   GFile     *new_file;
+  gchar      buf[PATH_MAX] = {0};
+
+  /* filename could be a symlink: read the actual path to rc file then */
+  if (readlink (filename, buf, sizeof (buf)-1) != -1)
+    filename = buf;
 
   /* get new file location */
   new_file = g_file_new_for_path (filename);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list