From: Thibault Godouet Date: Mon, 22 Sep 2008 18:17:18 +0000 (+0100) Subject: fcrontab: chdir to tmp_path before executing the editor (some needs to be able to... X-Git-Tag: ver3_0_5~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e985a5864e5811fda6ad8dabb9c0da9e9fbd6a2;p=thirdparty%2Ffcron.git fcrontab: chdir to tmp_path before executing the editor (some needs to be able to get information on current dir!) + make git ignore *~ files --- diff --git a/.gitignore b/.gitignore index bd7f74d..926ecf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*~ *.o Makefile autom4te.cache diff --git a/fcrontab.c b/fcrontab.c index d435ec2..cfe31c5 100644 --- a/fcrontab.c +++ b/fcrontab.c @@ -511,6 +511,7 @@ edit_file(char *buf) } } snprintf(editorcmd, sizeof(editorcmd), "%s %s", cureditor, tmp_str); + chdir(tmp_path); execlp(shell, shell, "-c", editorcmd, tmp_str, NULL); error_e("Error while running \"%s\"", cureditor); goto exiterr;