diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 4 | ||||
-rw-r--r-- | src/compose.c | 23 |
3 files changed, 28 insertions, 4 deletions
@@ -1,3 +1,8 @@ +2006-03-07 + + * src/compose.c: compose_get_signature_str(): allow relative signature + path. + 2006-03-06 * src/textview.c: textview_uri_security_check(): ignore trailing path diff --git a/ChangeLog.ja b/ChangeLog.ja index 1b9d952b..62bfb8cb 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,7 @@ +2006-03-07 + + * src/compose.c: compose_get_signature_str(): 相対署名パスを許可。 + 2006-03-06 * src/textview.c: textview_uri_security_check(): URI を比較する際 diff --git a/src/compose.c b/src/compose.c index 844b8f53..c6dc645e 100644 --- a/src/compose.c +++ b/src/compose.c @@ -1783,6 +1783,7 @@ static void compose_enable_sig(Compose *compose) static gchar *compose_get_signature_str(Compose *compose) { + gchar *sig_path; gchar *sig_body = NULL; gchar *sig_str = NULL; gchar *utf8_sig_str = NULL; @@ -1791,26 +1792,40 @@ static gchar *compose_get_signature_str(Compose *compose) if (!compose->account->sig_path) return NULL; + if (g_path_is_absolute(compose->account->sig_path) || + compose->account->sig_type == SIG_COMMAND) + sig_path = g_strdup(compose->account->sig_path); + else { +#ifdef G_OS_WIN32 + sig_path = g_strconcat(get_rc_dir(), +#else + sig_path = g_strconcat(get_home_dir(), +#endif + G_DIR_SEPARATOR_S, + compose->account->sig_path, NULL); + } if (compose->account->sig_type == SIG_FILE) { - if (!is_file_or_fifo_exist(compose->account->sig_path)) { + if (!is_file_or_fifo_exist(sig_path)) { debug_print("can't open signature file: %s\n", - compose->account->sig_path); + sig_path); + g_free(sig_path); return NULL; } } if (compose->account->sig_type == SIG_COMMAND) - sig_body = get_command_output(compose->account->sig_path); + sig_body = get_command_output(sig_path); else { gchar *tmp; - tmp = file_read_to_str(compose->account->sig_path); + tmp = file_read_to_str(sig_path); if (!tmp) return NULL; sig_body = normalize_newlines(tmp); g_free(tmp); } + g_free(sig_path); if (prefs_common.sig_sep) { sig_str = g_strconcat(prefs_common.sig_sep, "\n", sig_body, |