Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Add quotes to exec command in mu find #311

wants to merge 1 commit into from

2 participants


I came across this when I was trying to find messages and show it in less mu find whatever --exec "less".

If messages are found in paths containing spaces like ~/Mail/account/[Gmail] All Messages/, less is called with the parts and won't find the files.


Ah, good catch. However, the fix should probably also handle e.g. where there's are quotation marks etc. in the string.


I'm not a C expert. But as it seems putting double quotes around the file name should solve the problem. Double quotes are escaped.


This is solved now, using g_shell_quote.

@djcb djcb closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 9, 2013
  1. @iltempo
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  mu/mu-cmd-find.c
2  mu/mu-cmd-find.c
@@ -145,7 +145,7 @@ exec_cmd (MuMsg *msg, MuMsgIter *iter, MuConfig *opts, GError **err)
gboolean rv;
escpath = g_strescape (mu_msg_get_path (msg), NULL);
- cmdline = g_strdup_printf ("%s %s", opts->exec, escpath);
+ cmdline = g_strdup_printf ("%s '%s'", opts->exec, escpath);
rv = g_spawn_command_line_sync (cmdline, NULL, NULL, &status, err);
Something went wrong with that request. Please try again.