From 714189a28d672dc3a13b04da994e50849d265276 Mon Sep 17 00:00:00 2001 From: Peter Valchev Date: Mon, 17 Sep 2001 04:42:56 +0000 Subject: make vi exit if it can't create a temp file. From NetBSD, ok millert --- usr.bin/vi/common/exf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'usr.bin') 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), -- cgit v1.2.3