From efb78e824818a83e253c7222dd2bfa655ad969c9 Mon Sep 17 00:00:00 2001 From: millert Date: Mon, 27 Jul 1998 03:37:26 +0000 Subject: update to ncurses-4.2-980725 --- lib/libcurses/lib_screen.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/libcurses/lib_screen.c') 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 #include /* 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); -- cgit v1.2.3-59-g8ed1b