summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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),