talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 96021060a1850b3e33e94cc113ad7a403a48fdb2
parent 4e0e3643ec74297b135f50f4314f6d0d82326adf
Author: Colin Leroy <colin@colino.net>
Date:   Wed, 23 Jan 2013 16:17:00 +0000

2013-01-23 [colin]	3.9.0cvs59

	* src/action.c
	* src/common/utils.c
		Fix actions with spaces (and quotes). Thanks to H. Merijn Brand

Diffstat:
MChangeLog | 6++++++
MPATCHSETS | 1+
Mconfigure.ac | 8++++----
Msrc/action.c | 15+++++++++++----
Msrc/common/utils.c | 3+++
5 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,9 @@ +2013-01-23 [colin] 3.9.0cvs59 + + * src/action.c + * src/common/utils.c + Fix actions with spaces (and quotes). Thanks to H. Merijn Brand + 2013-01-23 [colin] 3.9.0cvs58 * src/imap.c diff --git a/PATCHSETS b/PATCHSETS @@ -4556,3 +4556,4 @@ ( cvs diff -u -r 1.9.2.61 -r 1.9.2.62 src/common/defs.h; cvs diff -u -r 1.4.2.88 -r 1.4.2.89 src/gtk/about.c; ) > 3.9.0cvs56.patchset ( cvs diff -u -r 1.15.2.29 -r 1.15.2.30 src/codeconv.h; cvs diff -u -r 1.49.2.154 -r 1.49.2.155 src/procmime.c; ) > 3.9.0cvs57.patchset ( cvs diff -u -r 1.179.2.270 -r 1.179.2.271 src/imap.c; ) > 3.9.0cvs58.patchset +( cvs diff -u -r 1.12.2.80 -r 1.12.2.81 src/action.c; cvs diff -u -r 1.36.2.212 -r 1.36.2.213 src/common/utils.c; ) > 3.9.0cvs59.patchset diff --git a/configure.ac b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=9 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=58 +EXTRA_VERSION=59 EXTRA_RELEASE= EXTRA_GTK2_VERSION= @@ -158,9 +158,9 @@ fi CFLAGS="$CFLAGS -Wall" -#if test $USE_MAINTAINER_MODE = yes; then -# CFLAGS="-g -Wall -Wno-pointer-sign -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_DEPRECATED -DGSEAL_ENABLE" -#fi +if test $USE_MAINTAINER_MODE = yes; then + CFLAGS="-g -Wall -Wno-pointer-sign" +fi pthread_name= case "$target" in diff --git a/src/action.c b/src/action.c @@ -386,8 +386,9 @@ static gboolean parse_append_filename(GString *cmd, MsgInfo *msginfo) } p = filename; + g_string_append(cmd, "\""); #ifdef G_OS_UNIX - while ((q = strpbrk(p, "$\"`'\\ \t*?[]&|;<>()!#~")) != NULL) { + while ((q = strpbrk(p, "$\"`\\~")) != NULL) { escape_ch[1] = *q; *q = '\0'; g_string_append(cmd, p); @@ -397,10 +398,9 @@ static gboolean parse_append_filename(GString *cmd, MsgInfo *msginfo) g_string_append(cmd, p); #else - g_string_append(cmd, "\""); g_string_append(cmd, filename); - g_string_append(cmd, "\""); #endif + g_string_append(cmd, "\""); g_free(filename); return TRUE; @@ -948,8 +948,15 @@ static ChildInfo *fork_child(gchar *cmd, const gchar *msg_str, while (g_ascii_isspace(trim_cmd[0])) trim_cmd++; +#ifdef G_OS_UNIX + argv = g_new0(gchar *, 4); + argv[0] = g_strdup("/bin/sh"); + argv[1] = g_strdup("-c"); + argv[2] = g_strdup(trim_cmd); + argv[3] = 0; +#else argv = strsplit_with_quote(trim_cmd, " ", 0); - +#endif g_free(ret_str); if (follow_child) { diff --git a/src/common/utils.c b/src/common/utils.c @@ -1273,6 +1273,9 @@ static gchar *strstr_with_skip_quote(const gchar *haystack, const gchar *needle) in_dquote = FALSE; else if (!in_squote) in_dquote = TRUE; + } else if (*haystack == '\\') { + haystack++; + haystack_len--; } haystack++;