summaryrefslogtreecommitdiff
path: root/usr.sbin/edquota/edquota.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-06 12:00:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-06 12:00:56 +0000
commitee305bb7990cf6945309f59e90e3a4ad3b30cbce (patch)
treec3b7d23c56cf85a52775ee4b7ec813758a60b449 /usr.sbin/edquota/edquota.c
parenta3b47a0577759ba42d64a2de77851874a2cffb38 (diff)
use system, so that $EDITOR expansion works
Diffstat (limited to 'usr.sbin/edquota/edquota.c')
-rw-r--r--usr.sbin/edquota/edquota.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c
index a78afda4325..5c3c9ce01cf 100644
--- a/usr.sbin/edquota/edquota.c
+++ b/usr.sbin/edquota/edquota.c
@@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)edquota.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$Id: edquota.c,v 1.6 1996/04/25 11:04:08 deraadt Exp $";
+static char *rcsid = "$Id: edquota.c,v 1.7 1996/06/06 12:00:55 deraadt Exp $";
#endif /* not lint */
/*
@@ -347,14 +347,17 @@ editit(tmpfile)
}
if (pid == 0) {
register char *ed;
+ char *p;
sigsetmask(omask);
setgid(getgid());
setuid(getuid());
if ((ed = getenv("EDITOR")) == (char *)0)
ed = _PATH_VI;
- execlp(ed, ed, tmpfile, 0);
- perror(ed);
+ p = (char *)malloc(strlen(ed) + 1 + strlen(tmpfile) + 1);
+ sprintf(p, "%s %s", ed, tmpfile);
+ if (system(p) == -1)
+ perror(ed);
exit(1);
}
waitpid(pid, &stat, 0);