summaryrefslogtreecommitdiffstats
path: root/mx.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-08-27 09:51:21 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-08-27 09:51:21 +0000
commitded841840b473842a49f4f3627f488ca323d05b1 (patch)
tree77ccc600bba3b9f794dbb7a689416d950b16725e /mx.c
parent805fcf41165c20f8b38ad76e8518114f9b976117 (diff)
[patch-0.94.4i.tlr.shell_quote.1] Try to quote file name
arguments and the like for shell commands.
Diffstat (limited to 'mx.c')
-rw-r--r--mx.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mx.c b/mx.c
index aaf1c45a..ce611617 100644
--- a/mx.c
+++ b/mx.c
@@ -73,10 +73,13 @@ static int invoke_dotlock(const char *path, int flags, int retry)
{
char cmd[LONG_STRING + _POSIX_PATH_MAX];
char r[SHORT_STRING];
+ char *f;
if(flags & DL_FL_RETRY)
snprintf(r, sizeof(r), "-r %d ", retry ? MAXLOCKATTEMPT : 0);
+ f = mutt_quote_filename(path);
+
snprintf(cmd, sizeof(cmd),
"%s %s%s%s%s%s%s",
DOTLOCK,
@@ -85,7 +88,9 @@ static int invoke_dotlock(const char *path, int flags, int retry)
flags & DL_FL_USEPRIV ? "-p " : "",
flags & DL_FL_FORCE ? "-f " : "",
flags & DL_FL_RETRY ? r : "",
- path);
+ f);
+
+ FREE(&f);
return mutt_system(cmd);
}