From 5e985a5864e5811fda6ad8dabb9c0da9e9fbd6a2 Mon Sep 17 00:00:00 2001 From: Thibault Godouet Date: Mon, 22 Sep 2008 19:17:18 +0100 Subject: [PATCH] fcrontab: chdir to tmp_path before executing the editor (some needs to be able to get information on current dir!) + make git ignore *~ files --- .gitignore | 1 + fcrontab.c | 1 + 2 files changed, 2 insertions(+) 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; -- 2.47.3