summaryrefslogtreecommitdiffstats
path: root/mx.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1999-02-04 12:00:06 +0000
committerThomas Roessler <roessler@does-not-exist.org>1999-02-04 12:00:06 +0000
commite4f9683bb99a38bd46b9e7f2d18d2a35dfcd94bf (patch)
treeb765f6a784cf58ada88b5d16def42445469176cf /mx.c
parent76ea47a1427257bd85b365dcee6a4ec48eb06830 (diff)
[unstable] Change the way mutt_quote_filename() worked. It's not
too reasonable to allocate memory dynamically whenever we quote a file name. (I guess I should add "vim" to pgpinvoke.c's copyright notice. :-)
Diffstat (limited to 'mx.c')
-rw-r--r--mx.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/mx.c b/mx.c
index 3c04a9a0..f5deb166 100644
--- a/mx.c
+++ b/mx.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 1996-8 Michael R. Elkins <me@cs.hmc.edu>
+ * Copyright (C) 1999 Thomas Roessler <roessler@guug.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -65,18 +66,18 @@
#ifdef DL_STANDALONE
-static int invoke_dotlock(const char *path, int flags, int retry)
+static int invoke_dotlock (const char *path, int flags, int retry)
{
char cmd[LONG_STRING + _POSIX_PATH_MAX];
+ char f[SHORT_STRING + _POSIX_PATH_MAX];
char r[SHORT_STRING];
- char *f;
- if(flags & DL_FL_RETRY)
- snprintf(r, sizeof(r), "-r %d ", retry ? MAXLOCKATTEMPT : 0);
+ if (flags & DL_FL_RETRY)
+ snprintf (r, sizeof (r), "-r %d ", retry ? MAXLOCKATTEMPT : 0);
- f = mutt_quote_filename(path);
+ mutt_quote_filename (f, sizeof (f), path);
- snprintf(cmd, sizeof(cmd),
+ snprintf (cmd, sizeof (cmd),
"%s %s%s%s%s%s%s",
DOTLOCK,
flags & DL_FL_TRY ? "-t " : "",
@@ -86,9 +87,7 @@ static int invoke_dotlock(const char *path, int flags, int retry)
flags & DL_FL_RETRY ? r : "",
f);
- FREE(&f);
-
- return mutt_system(cmd);
+ return mutt_system (cmd);
}
#else