aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-03-07 02:01:28 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-03-07 02:01:28 +0000
commit3dfde2b2ca388030038a65d6dba71a8571378997 (patch)
treeba7cf9ec258818c36b1391e54b9d7c65a97681c4 /src
parentd4a7ef91847a3f8fe5f0ccf193358b0932f544d1 (diff)
allow relative signature path.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1031 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/compose.c23
1 files changed, 19 insertions, 4 deletions
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,