summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1998-08-03 17:02:37 +0000
committermillert <millert@openbsd.org>1998-08-03 17:02:37 +0000
commit5b3ddac3e66f0d0f37141aef8301ece310cd7b9c (patch)
tree2f295b6eae819ce81f050b23e3c2cd8de6086ae3
parentSet SO_REUSEADDR on printer/tcp service (port 515); csapuntz@clearviewtech.com (diff)
downloadwireguard-openbsd-5b3ddac3e66f0d0f37141aef8301ece310cd7b9c.tar.xz
wireguard-openbsd-5b3ddac3e66f0d0f37141aef8301ece310cd7b9c.zip
update to ncurses-4.2-980801
-rw-r--r--lib/libcurses/comp_error.c6
-rw-r--r--lib/libcurses/curses.h4
-rw-r--r--lib/libcurses/lib_color.c7
-rw-r--r--lib/libcurses/lib_vidattr.c42
-rw-r--r--lib/libcurses/write_entry.c31
5 files changed, 50 insertions, 40 deletions
diff --git a/lib/libcurses/comp_error.c b/lib/libcurses/comp_error.c
index b2e43c5389f..4043f16cb50 100644
--- a/lib/libcurses/comp_error.c
+++ b/lib/libcurses/comp_error.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: comp_error.c,v 1.1 1998/07/23 21:17:25 millert Exp $ */
+/* $OpenBSD: comp_error.c,v 1.2 1998/08/03 17:02:37 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -43,7 +43,7 @@
#include <tic.h>
-MODULE_ID("$From: comp_error.c,v 1.15 1998/07/18 00:04:00 tom Exp $")
+MODULE_ID("$From: comp_error.c,v 1.16 1998/08/01 23:39:51 tom Exp $")
bool _nc_suppress_warnings;
int _nc_curr_line; /* current line # in input */
@@ -124,7 +124,7 @@ va_list argp;
/* If we're debugging, try to show where the problem occurred - this
* will dump core.
*/
-#if defined(TRACE) || defined(NDEBUG)
+#if defined(TRACE) || !defined(NDEBUG)
abort();
#else
/* Dumping core in production code is not a good idea.
diff --git a/lib/libcurses/curses.h b/lib/libcurses/curses.h
index 748322b93dd..0d5662dfead 100644
--- a/lib/libcurses/curses.h
+++ b/lib/libcurses/curses.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: curses.h,v 1.9 1998/07/27 03:37:28 millert Exp $ */
+/* $OpenBSD: curses.h,v 1.10 1998/08/03 17:02:43 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -50,7 +50,7 @@
/* These are defined only in curses.h, and are used for conditional compiles */
#define NCURSES_VERSION_MAJOR 4
#define NCURSES_VERSION_MINOR 2
-#define NCURSES_VERSION_PATCH 980725
+#define NCURSES_VERSION_PATCH 980801
/* This is defined in more than one ncurses header, for identification */
#undef NCURSES_VERSION
diff --git a/lib/libcurses/lib_color.c b/lib/libcurses/lib_color.c
index bebe9310d0d..a1a53e02768 100644
--- a/lib/libcurses/lib_color.c
+++ b/lib/libcurses/lib_color.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_color.c,v 1.5 1998/07/23 21:18:36 millert Exp $ */
+/* $OpenBSD: lib_color.c,v 1.6 1998/08/03 17:02:45 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -43,7 +43,7 @@
#include <term.h>
-MODULE_ID("$From: lib_color.c,v 1.30 1998/06/28 00:10:19 tom Exp $")
+MODULE_ID("$From: lib_color.c,v 1.31 1998/08/01 22:21:29 tom Exp $")
/*
* These should be screen structure members. They need to be globals for
@@ -366,9 +366,6 @@ void _nc_do_color(int pair, bool reverse, int (*outc)(int))
{
short fg, bg;
- if (reverse)
- pair = -pair;
-
if (pair == 0)
{
if (orig_pair)
diff --git a/lib/libcurses/lib_vidattr.c b/lib/libcurses/lib_vidattr.c
index 4432cb0e1dd..fa375131990 100644
--- a/lib/libcurses/lib_vidattr.c
+++ b/lib/libcurses/lib_vidattr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_vidattr.c,v 1.4 1998/07/23 21:19:47 millert Exp $ */
+/* $OpenBSD: lib_vidattr.c,v 1.5 1998/08/03 17:02:46 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -66,7 +66,7 @@
#include <curses.priv.h>
#include <term.h>
-MODULE_ID("$From: lib_vidattr.c,v 1.20 1998/02/11 12:13:56 tom Exp $")
+MODULE_ID("$From: lib_vidattr.c,v 1.21 1998/08/01 22:21:19 tom Exp $")
#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc)
@@ -76,11 +76,22 @@ MODULE_ID("$From: lib_vidattr.c,v 1.20 1998/02/11 12:13:56 tom Exp $")
#define TurnOff(mask,mode) \
if ((turn_off & mask) && mode) { doPut(mode); turn_off &= ~mask; }
+ /* if there is no current screen, assume we *can* do color */
+#define SetColorsIf(why,old_attr) \
+ if ((!SP || SP->_coloron) && (why)) { \
+ int old_pair = PAIR_NUMBER(old_attr); \
+ T(("old pair = %d -- new pair = %d", old_pair, pair)); \
+ if ((pair != old_pair) \
+ || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \
+ _nc_do_color(pair, reverse, outc); \
+ } \
+ }
+
int vidputs(attr_t newmode, int (*outc)(int))
{
static attr_t previous_attr = A_NORMAL;
attr_t turn_on, turn_off;
-int pair, current_pair;
+int pair;
bool reverse = FALSE;
bool used_ncv = FALSE;
@@ -134,26 +145,15 @@ bool used_ncv = FALSE;
returnCode(OK);
pair = PAIR_NUMBER(newmode);
- current_pair = PAIR_NUMBER(previous_attr);
if (reverse) {
newmode &= ~A_REVERSE;
- pair = -pair;
}
- if (previous_attr & A_REVERSE)
- current_pair = -current_pair;
turn_off = (~newmode & previous_attr) & ALL_BUT_COLOR;
turn_on = (newmode & ~previous_attr) & ALL_BUT_COLOR;
- /* if there is no current screen, assume we *can* do color */
- if ((!SP || SP->_coloron) && pair == 0) {
- T(("old pair = %d -- new pair = %d", current_pair, pair));
- if (pair != current_pair) {
- _nc_do_color(pair, reverse, outc);
- previous_attr &= ~A_COLOR;
- }
- }
+ SetColorsIf(pair == 0, previous_attr);
if (newmode == A_NORMAL) {
if((previous_attr & A_ALTCHARSET) && exit_alt_charset_mode) {
@@ -165,6 +165,7 @@ bool used_ncv = FALSE;
previous_attr &= ~A_COLOR;
}
+ SetColorsIf(pair != 0, previous_attr);
} else if (set_attributes && !used_ncv) {
if (turn_on || turn_off) {
TPUTS_TRACE("set_attributes");
@@ -180,6 +181,7 @@ bool used_ncv = FALSE;
(newmode & A_ALTCHARSET) != 0), 1, outc);
previous_attr &= ~A_COLOR;
}
+ SetColorsIf(pair != 0, previous_attr);
} else {
T(("turning %s off", _traceattr(turn_off)));
@@ -193,6 +195,7 @@ bool used_ncv = FALSE;
turn_on |= (newmode & (chtype)(~A_COLOR));
previous_attr &= ~A_COLOR;
}
+ SetColorsIf(pair != 0, previous_attr);
T(("turning %s on", _traceattr(turn_on)));
@@ -213,15 +216,6 @@ bool used_ncv = FALSE;
TurnOn (A_VERTICAL, enter_vertical_hl_mode);
}
- /* if there is no current screen, assume we *can* do color */
- if ((!SP || SP->_coloron) && pair != 0) {
- current_pair = PAIR_NUMBER(previous_attr);
- T(("old pair = %d -- new pair = %d", current_pair, pair));
- if (pair != current_pair) {
- _nc_do_color(pair, reverse, outc);
- }
- }
-
if (reverse)
newmode |= A_REVERSE;
diff --git a/lib/libcurses/write_entry.c b/lib/libcurses/write_entry.c
index ccf93dd25ac..d7b3402b4d0 100644
--- a/lib/libcurses/write_entry.c
+++ b/lib/libcurses/write_entry.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: write_entry.c,v 1.2 1998/07/27 03:37:37 millert Exp $ */
+/* $OpenBSD: write_entry.c,v 1.3 1998/08/03 17:02:47 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -51,7 +51,7 @@
#define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR)
#endif
-MODULE_ID("$From: write_entry.c,v 1.28 1998/07/25 20:11:51 tom Exp $")
+MODULE_ID("$From: write_entry.c,v 1.30 1998/08/01 23:46:32 tom Exp $")
static int total_written;
@@ -215,6 +215,7 @@ char symlinkname[PATH_MAX];
#endif /* USE_SYMLINKS */
static int call_count;
static time_t start_time; /* time at start of writes */
+int code;
if (call_count++ == 0) {
start_time = 0;
@@ -314,17 +315,35 @@ static time_t start_time; /* time at start of writes */
symlinkname[sizeof(symlinkname) - 1] = '\0';
#endif /* USE_SYMLINKS */
#if HAVE_REMOVE
- remove(linkname);
+ code = remove(linkname);
#else
- unlink(linkname);
+ code = unlink(linkname);
#endif
+ if (code != 0 && errno == ENOENT)
+ code = 0;
#if USE_SYMLINKS
if (symlink(symlinkname, linkname) < 0)
#else
if (link(filename, linkname) < 0)
#endif /* USE_SYMLINKS */
- _nc_syserr_abort("can't link %s to %s", filename, linkname);
- DEBUG(1, ("Linked %s", linkname));
+ {
+ /*
+ * If there wasn't anything there, and we cannot
+ * link to the target because it is the same as the
+ * target, then the source must be on a filesystem
+ * that uses caseless filenames, such as Win32, etc.
+ */
+ if (code == 0 && errno == EEXIST)
+ _nc_warning("can't link %s to %s", filename, linkname);
+ else if (code == 0 && errno == EPERM)
+ write_file(linkname, tp);
+ else
+ _nc_syserr_abort("can't link %s to %s", filename, linkname);
+ }
+ else
+ {
+ DEBUG(1, ("Linked %s", linkname));
+ }
}
#else /* just make copies */
write_file(linkname, tp);