From 93f92fb5d7dcdf97236419a49b31e7a9dc72f685 Mon Sep 17 00:00:00 2001 From: thib Date: Sat, 2 Feb 2002 14:51:36 +0000 Subject: [PATCH] we can now use arguments in the var EDITOR and VISUAL. --- fcrontab.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fcrontab.c b/fcrontab.c index 6454425..a124498 100644 --- a/fcrontab.c +++ b/fcrontab.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcrontab.c,v 1.53 2001-12-23 22:04:10 thib Exp $ */ + /* $Id: fcrontab.c,v 1.54 2002-02-02 14:51:36 thib Exp $ */ /* * The goal of this program is simple : giving a user interface to fcron @@ -45,7 +45,7 @@ #include "allow.h" #include "fileconf.h" -char rcs_info[] = "$Id: fcrontab.c,v 1.53 2001-12-23 22:04:10 thib Exp $"; +char rcs_info[] = "$Id: fcrontab.c,v 1.54 2002-02-02 14:51:36 thib Exp $"; void info(void); void usage(void); @@ -358,6 +358,7 @@ edit_file(char *buf) if necessary */ { char *cureditor = NULL; + char editorcmd[FNAME_LEN]; pid_t pid; int status; struct stat st; @@ -429,7 +430,8 @@ edit_file(char *buf) } } - execlp(cureditor, cureditor, tmp_str, NULL); + snprintf(editorcmd, sizeof(editorcmd), "%s %s", cureditor, tmp_str); + execlp(shell, shell, "-c", editorcmd, tmp_str, NULL); error_e("Error while running \"%s\"", cureditor); goto exiterr; -- 2.40.0