summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Valchev <pvalchev@cvs.openbsd.org>2001-09-17 04:42:56 +0000
committerPeter Valchev <pvalchev@cvs.openbsd.org>2001-09-17 04:42:56 +0000
commit714189a28d672dc3a13b04da994e50849d265276 (patch)
treed70ceee62f32f99d5e2dbff5f9efdfab38864890
parent3bee6a5e1f662651eded28070d56096713ae4a9e (diff)
make vi exit if it can't create a temp file. From NetBSD, ok millert
-rw-r--r--usr.bin/vi/common/exf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/vi/common/exf.c b/usr.bin/vi/common/exf.c
index d2b361d9f8b..4951ee385b1 100644
--- a/usr.bin/vi/common/exf.c
+++ b/usr.bin/vi/common/exf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exf.c,v 1.13 2001/06/18 21:39:25 millert Exp $ */
+/* $OpenBSD: exf.c,v 1.14 2001/09/17 04:42:55 pvalchev Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -185,6 +185,11 @@ file_init(sp, frp, rcv_name, flags)
*/
oname = frp->name;
if (LF_ISSET(FS_OPENERR) || oname == NULL || !exists) {
+ /*
+ * Don't try to create a temporary support file twice.
+ */
+ if (frp->tname != NULL)
+ goto err;
if (opts_empty(sp, O_DIRECTORY, 0))
goto err;
(void)snprintf(tname, sizeof(tname),