]> git.ipfire.org Git - thirdparty/fcron.git/commitdiff
fcrontab: chdir to tmp_path before executing the editor (some needs to be able to...
authorThibault Godouet <yo8192@users.noreply.github.com>
Mon, 22 Sep 2008 18:17:18 +0000 (19:17 +0100)
committerThibault Godouet <yo8192@users.noreply.github.com>
Mon, 22 Sep 2008 18:17:18 +0000 (19:17 +0100)
.gitignore
fcrontab.c

index bd7f74d29630b7d9635cd4e99f9cd6e5f922096b..926ecf992dc6a1b201e519097498d1478c27c88f 100644 (file)
@@ -1,3 +1,4 @@
+*~
 *.o
 Makefile
 autom4te.cache
index d435ec240c4fe334ce36e77d8331ddee3b309878..cfe31c55c1b610a7d4d23c067c21a913caca289e 100644 (file)
@@ -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;