[Commits] action.c 1.12.2.80 1.12.2.81
colin at claws-mail.org
colin at claws-mail.org
Wed Jan 23 17:16:58 CET 2013
Update of /home/claws-mail/claws/src
In directory srv:/tmp/cvs-serv29303/src
Modified Files:
Tag: gtk2
action.c
Log Message:
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
Index: action.c
===================================================================
RCS file: /home/claws-mail/claws/src/action.c,v
retrieving revision 1.12.2.80
retrieving revision 1.12.2.81
diff -u -d -r1.12.2.80 -r1.12.2.81
--- action.c 20 Dec 2012 09:23:44 -0000 1.12.2.80
+++ action.c 23 Jan 2013 16:16:55 -0000 1.12.2.81
@@ -386,8 +386,9 @@
}
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 @@
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 @@
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) {
More information about the Commits
mailing list