Module Name: src Committed By: christos Date: Sat Nov 4 14:20:13 UTC 2017
Modified Files: src/external/bsd/nvi/dist/common: recover.c Log Message: Don't use popenve() for portability; forking an extra shell here is not an issue. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/bsd/nvi/dist/common/recover.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/nvi/dist/common/recover.c diff -u src/external/bsd/nvi/dist/common/recover.c:1.8 src/external/bsd/nvi/dist/common/recover.c:1.9 --- src/external/bsd/nvi/dist/common/recover.c:1.8 Sat Nov 4 02:15:56 2017 +++ src/external/bsd/nvi/dist/common/recover.c Sat Nov 4 10:20:12 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: recover.c,v 1.8 2017/11/04 06:15:56 christos Exp $ */ +/* $NetBSD: recover.c,v 1.9 2017/11/04 14:20:12 christos Exp $ */ /*- * Copyright (c) 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -16,7 +16,7 @@ static const char sccsid[] = "Id: recover.c,v 10.31 2001/11/01 15:24:44 skimo Exp (Berkeley) Date: 2001/11/01 15:24:44 "; #endif /* not lint */ #else -__RCSID("$NetBSD: recover.c,v 1.8 2017/11/04 06:15:56 christos Exp $"); +__RCSID("$NetBSD: recover.c,v 1.9 2017/11/04 14:20:12 christos Exp $"); #endif #include <sys/param.h> @@ -871,8 +871,6 @@ rcv_mktemp(SCR *sp, char *path, const ch return (fd); } -extern char **environ; - /* * rcv_email -- * Send email. @@ -883,7 +881,6 @@ rcv_email(SCR *sp, const char *fname) struct stat sb; char buf[BUFSIZ]; FILE *fin, *fout; - const char *argv[4]; size_t l; if (_PATH_SENDMAIL[0] != '/' || stat(_PATH_SENDMAIL, &sb) == -1) { @@ -910,12 +907,7 @@ rcv_email(SCR *sp, const char *fname) return; } - argv[0] = _PATH_SENDMAIL; - argv[1] = "-t"; - argv[2] = fname; - argv[3] = NULL; - - fout = popenve(_PATH_SENDMAIL, __UNCONST(argv), environ, "w"); + fout = popen(_PATH_SENDMAIL " -t", "w"); if (fout == NULL) { msgq_str(sp, M_SYSERR, _PATH_SENDMAIL, "326|cannot execute sendmail: %s");