[Commits] [SCM] claws branch, master, updated. 3.14.1-172-g11cadab

ticho at claws-mail.org ticho at claws-mail.org
Fri Feb 3 19:04:52 CET 2017


The branch, master has been updated
       via  11cadab16219e789df3b7ffa06ebd106063fe8f0 (commit)
      from  2016b17dad8b37b72ae1678c217ed06ac12966a1 (commit)

Summary of changes:
 src/account.c |   25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)


- Log -----------------------------------------------------------------
commit 11cadab16219e789df3b7ffa06ebd106063fe8f0
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Fri Feb 3 19:03:19 2017 +0100

    Make a relative signature_path relative to home directory.
    
    This applies only if corresponding signature_type is SIG_FILE.

diff --git a/src/account.c b/src/account.c
index 9c44ef0..5ff5d64 100644
--- a/src/account.c
+++ b/src/account.c
@@ -1834,23 +1834,30 @@ gchar *account_get_signature_str(PrefsAccount *account)
 		return NULL;
 
 	if (account->sig_type == SIG_FILE) {
-		if (!is_file_or_fifo_exist(account->sig_path)) {
-			g_warning("can't open signature file: '%s'",
-				  account->sig_path);
+		gchar *sig_full_path;
+		if (!g_path_is_absolute(account->sig_path)) {
+			sig_full_path = g_build_filename(get_home_dir(), account->sig_path, NULL);
+		} else {
+			sig_full_path = g_strdup(account->sig_path);
+		}
+
+		if (!is_file_or_fifo_exist(sig_full_path)) {
+			g_warning("can't open signature file: '%s'", sig_full_path);
+			g_free(sig_full_path);
 			return NULL;
 		}
-	}
 
-	if (account->sig_type == SIG_COMMAND)
-		sig_body = get_command_output(account->sig_path);
-	else {
-		gchar *tmp;
+		debug_print("Reading signature from file '%s'\n", sig_full_path);
+		gchar *tmp = file_read_to_str(sig_full_path);
+		g_free(sig_full_path);
 
-		tmp = file_read_to_str(account->sig_path);
 		if (!tmp)
 			return NULL;
+
 		sig_body = normalize_newlines(tmp);
 		g_free(tmp);
+	} else {
+		sig_body = get_command_output(account->sig_path);
 	}
 
 	if (account->sig_sep) {

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list