diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-07-29 20:10:18 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-07-29 20:10:18 +0000 |
commit | 1cf66542404ed6558826b76b2f4483c16ec0f574 (patch) | |
tree | 57995b1c277f3cab03d2dcf38b518014adc7085d /usr.bin/patch/pch.c | |
parent | 4992af84d9296d2574aa9fdeabfec0cc7e608289 (diff) |
o add pathnames.h
o ignore empty TMPDIR environment variable
o strip any trailing slashes from TMPDIR
otto@ OK
Diffstat (limited to 'usr.bin/patch/pch.c')
-rw-r--r-- | usr.bin/patch/pch.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c index be863a9ba9d..79fb6696dcf 100644 --- a/usr.bin/patch/pch.c +++ b/usr.bin/patch/pch.c @@ -1,7 +1,7 @@ -/* $OpenBSD: pch.c,v 1.26 2003/07/28 19:15:34 deraadt Exp $ */ +/* $OpenBSD: pch.c,v 1.27 2003/07/29 20:10:17 millert Exp $ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: pch.c,v 1.26 2003/07/28 19:15:34 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: pch.c,v 1.27 2003/07/29 20:10:17 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -17,6 +17,7 @@ static const char rcsid[] = "$OpenBSD: pch.c,v 1.26 2003/07/28 19:15:34 deraadt #include "common.h" #include "util.h" #include "pch.h" +#include "pathnames.h" /* Patch (diff listing) abstract type. */ @@ -1320,10 +1321,8 @@ do_ed_script(void) unlink(TMPOUTNAME); fatal("can't create temp file %s", TMPOUTNAME); } - if (verbose) - snprintf(buf, sizeof buf, "/bin/ed %s", TMPOUTNAME); - else - snprintf(buf, sizeof buf, "/bin/ed - %s", TMPOUTNAME); + snprintf(buf, sizeof buf, "%s%s%s", _PATH_ED, + verbose ? " " : " -s ", TMPOUTNAME); pipefp = popen(buf, "w"); } for (;;) { |