summaryrefslogtreecommitdiffstats
path: root/lib/libcurses/lib_screen.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1998-07-27 03:37:26 +0000
committermillert <millert@openbsd.org>1998-07-27 03:37:26 +0000
commitefb78e824818a83e253c7222dd2bfa655ad969c9 (patch)
tree1118a04b7e8d27ae546f28ef2b351f9254bec783 /lib/libcurses/lib_screen.c
parentAdd missing files (diff)
downloadwireguard-openbsd-efb78e824818a83e253c7222dd2bfa655ad969c9.tar.xz
wireguard-openbsd-efb78e824818a83e253c7222dd2bfa655ad969c9.zip
update to ncurses-4.2-980725
Diffstat (limited to 'lib/libcurses/lib_screen.c')
-rw-r--r--lib/libcurses/lib_screen.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/libcurses/lib_screen.c b/lib/libcurses/lib_screen.c
index a3b83ce6934..6e7c6727d40 100644
--- a/lib/libcurses/lib_screen.c
+++ b/lib/libcurses/lib_screen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_screen.c,v 1.5 1998/07/23 21:19:19 millert Exp $ */
+/* $OpenBSD: lib_screen.c,v 1.6 1998/07/27 03:37:31 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -40,7 +40,7 @@
#include <time.h>
#include <term.h> /* exit_ca_mode, non_rev_rmcup */
-MODULE_ID("$From: lib_screen.c,v 1.11 1998/02/11 12:13:56 tom Exp $")
+MODULE_ID("$From: lib_screen.c,v 1.13 1998/07/25 20:10:48 tom Exp $")
static time_t dumptime;
@@ -131,7 +131,8 @@ int scr_restore(const char *file)
T((T_CALLED("scr_restore(%s)"), _nc_visbuf(file)));
- if ((fp = fopen(file, "rb")) == 0)
+ if (_nc_access(file, R_OK) < 0
+ || (fp = fopen(file, "rb")) == 0)
returnCode(ERR);
else
{
@@ -148,7 +149,8 @@ int scr_dump(const char *file)
T((T_CALLED("scr_dump(%s)"), _nc_visbuf(file)));
- if ((fp = fopen(file, "wb")) == 0)
+ if (_nc_access(file, W_OK) < 0
+ || (fp = fopen(file, "wb")) == 0)
returnCode(ERR);
else
{
@@ -171,7 +173,8 @@ int scr_init(const char *file)
returnCode(ERR);
#endif /* exit_ca_mode */
- if ((fp = fopen(file, "rb")) == 0)
+ if (_nc_access(file, R_OK) < 0
+ || (fp = fopen(file, "rb")) == 0)
returnCode(ERR);
else if (fstat(STDOUT_FILENO, &stb) || stb.st_mtime > dumptime)
returnCode(ERR);