# ------------------------------------------------------------------------------
# Tekproc.c | 16 ++++-----
# button.c | 4 +-
# charproc.c | 45 +++++++++++++++++++++++++-
# main.c | 93 ++++++++++++++++++-------------------------------------
# ptyx.h | 2 +
# scrollbar.c | 12 +++----
# terminfo | 4 +-
# util.c | 2 -
# version.h | 2 -
# xterm.log.html | 28 ++++++++++++++++
# 10 files changed, 122 insertions, 86 deletions
# ------------------------------------------------------------------------------
Index: Tekproc.c
--- xterm-80+/Tekproc.c Fri Jun 5 16:23:53 1998
+++ xterm-81/Tekproc.c Mon Jul 13 20:02:22 1998
@@ -719,11 +719,12 @@
&crocktimeout);
#endif
#ifndef AMOEBA
- if(FD_ISSET (screen->respond, &Tselect_mask)) {
+ if(FD_ISSET (screen->respond, &Tselect_mask))
#else
/* XXX resolve polling since it wastes CPU cycles */
- if ((Tbcnt = cb_full(screen->tty_outq)) > 0) {
+ if ((Tbcnt = cb_full(screen->tty_outq)) > 0)
#endif /* AMOEBA */
+ {
#ifdef ALLOWLOGGING
if(screen->logging)
FlushLog(screen);
@@ -1732,10 +1733,8 @@
using access before the open still leaves a small window
of opportunity. */
pid = fork();
- switch (pid)
- {
- case 0: /* child */
- {
+
+ if (pid == 0) { /* child */
register int tekcopyfd;
char initbuf[5];
register TekLink *Tp;
@@ -1756,11 +1755,10 @@
} while(Tp);
close(tekcopyfd);
_exit(0);
- }
- case -1: /* error */
+ } else if (pid < 0) { /* error */
Bell(XkbBI_MinorError,0);
return;
- default: /* parent */
+ } else { /* parent */
#ifdef HAVE_WAITPID
waitpid(pid, NULL, 0);
#else
Index: button.c
--- xterm-80+/button.c Fri Jun 5 16:23:53 1998
+++ xterm-81/button.c Mon Jul 13 06:51:32 1998
@@ -170,7 +170,7 @@
EditorButton((XButtonEvent *)event);
return True;
}
- /* fall through */
+ /* FALLTHRU */
default:
return False;
@@ -823,7 +823,7 @@
maximum value. */
{
register TScreen *screen = &term->screen;
- register row, col;
+ register int row, col;
row = (y - screen->border) / FontHeight(screen);
if(row < firstValidRow)
Index: charproc.c
--- xterm-80+/charproc.c Sun Jul 5 16:05:39 1998
+++ xterm-81/charproc.c Sun Jul 12 21:11:34 1998
@@ -3319,7 +3319,7 @@
unparseputc(int c, int fd)
{
Char buf[2];
- register i = 1;
+ register int i = 1;
#ifdef AMOEBA
if (ttypreprocess(c)) return;
@@ -4290,9 +4290,16 @@
{
register TScreen *screen = &term->screen;
register int x, y, flags;
- Char c;
+ Char c;
+ Char fg_bg = 0;
GC currentGC;
Boolean in_selection;
+ Pixel fg_pix;
+ Pixel bg_pix;
+ Pixel tmp;
+#if OPT_HIGHLIGHT_COLOR
+ Pixel hi_pix = screen->highlightcolor;
+#endif
if (screen->cursor_state == BLINKED_OFF)
return;
@@ -4318,6 +4325,18 @@
if (c == 0)
c = ' ';
+ /*
+ * Compare the current cell to the last set of colors used for the
+ * cursor and update the GC's if needed.
+ */
+#if OPT_ISO_COLORS
+ if_OPT_ISO_COLORS(screen,{
+ fg_bg = SCRN_BUF_COLOR(screen, screen->cursor_row)[screen->cursor_col];
+ })
+#endif
+ fg_pix = getXtermForeground(flags,extract_fg(fg_bg,flags));
+ bg_pix = getXtermBackground(flags,extract_bg(fg_bg));
+
if (screen->cur_row > screen->endHRow ||
(screen->cur_row == screen->endHRow &&
screen->cur_col >= screen->endHCol) ||
@@ -4328,6 +4347,10 @@
else
in_selection = True;
+ /* This is like updatedXtermGC(), except that we have to worry about
+ * whether the window has focus, since in that case we want just an
+ * outline for the cursor.
+ */
if(screen->select || screen->always_highlight) {
if (( (flags & INVERSE) && !in_selection) ||
(!(flags & INVERSE) && in_selection)){
@@ -4341,6 +4364,16 @@
currentGC = NormalGC(screen);
}
}
+#if OPT_HIGHLIGHT_COLOR
+ if (hi_pix != screen->foreground
+ && hi_pix != fg_pix
+ && hi_pix != bg_pix
+ && hi_pix != term->dft_foreground) {
+ bg_pix = fg_pix;
+ fg_pix = hi_pix;
+ }
+#endif
+ EXCHANGE(fg_pix, bg_pix, tmp)
} else { /* normal video */
if (screen->reversecursorGC) {
currentGC = screen->reversecursorGC;
@@ -4352,6 +4385,10 @@
}
}
}
+ if (screen->cursorcolor == term->dft_foreground) {
+ XSetForeground(screen->display, currentGC, bg_pix);
+ XSetBackground(screen->display, currentGC, fg_pix);
+ }
} else { /* not selected */
if (( (flags & INVERSE) && !in_selection) ||
(!(flags & INVERSE) && in_selection)) {
@@ -4359,6 +4396,10 @@
currentGC = ReverseGC(screen);
} else { /* normal video */
currentGC = NormalGC(screen);
+ }
+ if (screen->cursorcolor == term->dft_foreground) {
+ XSetForeground(screen->display, currentGC, fg_pix);
+ XSetBackground(screen->display, currentGC, bg_pix);
}
}
Index: main.c
--- xterm-80+/main.c Sun Jul 5 16:05:39 1998
+++ xterm-81/main.c Tue Jul 14 20:19:28 1998
@@ -169,6 +169,10 @@
#define KANJI
#endif
+#ifdef TIOCSLTC
+#define HAS_LTCHARS
+#endif
+
#ifdef linux
#define USE_TERMIOS
#define USE_SYSV_PGRP
@@ -177,6 +181,7 @@
#define HAS_UTMP_UT_HOST
#define LASTLOG
#define WTMP
+#undef HAS_LTCHARS
#endif
#ifdef __CYGWIN32__
@@ -189,7 +194,7 @@
#ifdef Lynx
#define USE_SYSV_TERMIO
-#undef TIOCSLTC
+#undef HAS_LTCHARS
#include <termio.h>
#endif
@@ -246,7 +251,7 @@
#endif /* USE_POSIX_TERMIOS */
#ifdef SVR4
-#undef TIOCSLTC /* defined, but not useable */
+#undef HAS_LTCHARS /* defined, but not useable */
#endif
#define USE_TERMCAP_ENVVARS /* every one uses this except SYSV maybe */
@@ -347,6 +352,7 @@
#endif
#if !defined(MINIX) && !defined(WIN32) && !defined(Lynx)
+#undef NBBY /* Xpoll.h has conflicting value that we don't use */
#include <sys/param.h> /* for NOFILE */
#endif
@@ -514,9 +520,9 @@
** contents.
*/
static struct termio d_tio;
-#ifdef TIOCSLTC
+#ifdef HAS_LTCHARS
static struct ltchars d_ltc;
-#endif /* TIOCSLTC */
+#endif /* HAS_LTCHARS */
#ifdef __sgi
#undef TIOCLSET /* XXX why is this undef-ed again? */
@@ -1237,14 +1243,14 @@
d_tio.c_cc[VMIN] = 1;
d_tio.c_cc[VTIME] = 0;
#endif /* } */
-#ifdef TIOCSLTC /* { */
+#ifdef HAS_LTCHARS /* { */
d_ltc.t_suspc = CSUSP; /* t_suspc */
d_ltc.t_dsuspc = CDSUSP; /* t_dsuspc */
d_ltc.t_rprntc = CRPRNT;
d_ltc.t_flushc = CFLUSH;
d_ltc.t_werasc = CWERASE;
d_ltc.t_lnextc = CLNEXT;
-#endif /* } TIOCSLTC */
+#endif /* } HAS_LTCHARS */
#ifdef TIOCLSET /* { */
d_lmode = 0;
#endif /* } TIOCLSET */
@@ -1378,14 +1384,14 @@
}
}
}
-#ifdef TIOCSLTC /* { */
+#ifdef HAS_LTCHARS /* { */
d_ltc.t_suspc = '\000'; /* t_suspc */
d_ltc.t_dsuspc = '\000'; /* t_dsuspc */
d_ltc.t_rprntc = '\377'; /* reserved...*/
d_ltc.t_flushc = '\377';
d_ltc.t_werasc = '\377';
d_ltc.t_lnextc = '\377';
-#endif /* } TIOCSLTC */
+#endif /* } HAS_LTCHARS */
#if defined(USE_TERMIOS) || defined(USE_POSIX_TERMIOS) /* { */
d_tio.c_cc[VSUSP] = CSUSP;
#ifdef VDSUSP
@@ -2137,9 +2143,9 @@
#ifdef TIOCLSET
unsigned lmode;
#endif /* TIOCLSET */
-#ifdef TIOCSLTC
+#ifdef HAS_LTCHARS
struct ltchars ltc;
-#endif /* TIOCSLTC */
+#endif /* HAS_LTCHARS */
#else /* else not USE_SYSV_TERMIO */
#ifdef USE_POSIX_TERMIOS
struct termios tio;
@@ -2240,9 +2246,9 @@
if (tty_got_hung || errno == ENXIO || errno == EIO ||
errno == EINVAL || errno == ENOTTY) {
no_dev_tty = TRUE;
-#ifdef TIOCSLTC
+#ifdef HAS_LTCHARS
ltc = d_ltc;
-#endif /* TIOCSLTC */
+#endif /* HAS_LTCHARS */
#ifdef TIOCLSET
lmode = d_lmode;
#endif /* TIOCLSET */
@@ -2267,10 +2273,10 @@
* if started directly from xdm or xinit,
* in which case we just use the defaults as above.
*/
-#ifdef TIOCSLTC
+#ifdef HAS_LTCHARS
if(ioctl(tty, TIOCGLTC, <c) == -1)
ltc = d_ltc;
-#endif /* TIOCSLTC */
+#endif /* HAS_LTCHARS */
#ifdef TIOCLSET
if(ioctl(tty, TIOCLGET, &lmode) == -1)
lmode = d_lmode;
@@ -2788,7 +2794,7 @@
#ifdef VSTOP
TMODE (XTTYMODE_stop, tio.c_cc[VSTOP]);
#endif
-#ifdef TIOCSLTC
+#ifdef HAS_LTCHARS
/* both SYSV and BSD have ltchars */
TMODE (XTTYMODE_susp, ltc.t_suspc);
TMODE (XTTYMODE_dsusp, ltc.t_dsuspc);
@@ -2800,7 +2806,7 @@
}
#undef TMODE
-#ifdef TIOCSLTC
+#ifdef HAS_LTCHARS
#ifdef __hpux
/* ioctl chokes when the "reserved" process group controls
* are not set to _POSIX_VDISABLE */
@@ -2809,7 +2815,7 @@
#endif /* __hpux */
if (ioctl (tty, TIOCSLTC, <c) == -1)
HsSysError(cp_pipe[1], ERROR_TIOCSETC);
-#endif /* TIOCSLTC */
+#endif /* HAS_LTCHARS */
#ifdef TIOCLSET
if (ioctl (tty, TIOCLSET, (char *)&lmode) == -1)
HsSysError(cp_pipe[1], ERROR_TIOCLSET);
@@ -3512,11 +3518,7 @@
* I made this a function since it cannot be a macro.
*/
void
-setcap(capvec, n, name, cap)
- struct caplist *capvec;
- int n;
- char *name;
- capability *cap;
+setcap(struct caplist *capvec, int n, char *name, capability *cap)
{
capvec[n].cl_name = name;
capvec[n].cl_cap = cap;
@@ -3527,9 +3529,7 @@
* necessarily running down the user's PATH.
*/
errstat
-find_program(program, programcap)
- char *program;
- capability *programcap;
+find_program(char *program, capability *programcap)
{
errstat err;
@@ -3568,13 +3568,13 @@
static semaphore main_sema;
void
-InitMainThread()
+InitMainThread(void)
{
sema_init(&main_sema, 0);
}
void
-WakeupMainThread()
+WakeupMainThread(void)
{
sema_up(&main_sema);
}
@@ -3651,6 +3651,7 @@
if (*ptr)
if (!TEK4014_ACTIVE(screen))
resize (screen, termcap, newtc);
+ }
}
if (!TermName) {
@@ -3817,7 +3818,7 @@
* X watch-dog thread. This thread unblocks the main
* thread when there's an X event.
*/
-xwatchdogthread()
+xwatchdogthread(void)
{
register TScreen *screen = &term->screen;
@@ -3834,7 +3835,7 @@
}
void
-SleepMainThread()
+SleepMainThread(void)
{
int remaining;
@@ -3897,12 +3898,12 @@
/* write it out only if it exists, and the pid's match */
if (utptr && (utptr->ut_pid == screen->pid)) {
utptr->ut_type = DEAD_PROCESS;
- *utptr->ut_user = 0;
#if defined(SVR4) || defined(SCO325) || (defined(linux) && __GLIBC__ >= 2)
utptr->ut_session = getsid(0);
utptr->ut_xtime = time ((time_t *) 0);
utptr->ut_tv.tv_usec = 0;
#else
+ *utptr->ut_user = 0;
utptr->ut_time = time((time_t *) 0);
#endif
(void) pututline(utptr);
@@ -4077,38 +4078,6 @@
SIGNAL_RETURN;
}
-
-#if 0 /* this isn't used, but could be useful in debugging */
-/* VARARGS1 */
-void
-consolepr(fmt,x0,x1,x2,x3,x4,x5,x6,x7,x8,x9)
-char *fmt;
-{
- int oerrno;
- int f;
- char buf[ BUFSIZ ];
-
- oerrno = errno;
- strcpy(buf, "xterm: ");
- sprintf(buf+strlen(buf), fmt, x0,x1,x2,x3,x4,x5,x6,x7,x8,x9);
- strcat(buf, ": ");
- strcat(buf, SysErrorMsg (oerrno));
- strcat(buf, "\n");
-#ifndef AMOEBA
- f = open("/dev/console",O_WRONLY);
- write(f, buf, strlen(buf));
- close(f);
-#else
- fputs(buf, stderr);
-#endif
-#ifdef TIOCNOTTY
- if ((f = open("/dev/tty", 2)) >= 0) {
- ioctl(f, TIOCNOTTY, (char *)NULL);
- close(f);
- }
-#endif /* TIOCNOTTY */
-}
-#endif
static int
remove_termcap_entry (char *buf, char *str)
Index: ptyx.h
--- xterm-80+/ptyx.h Sun Jul 5 16:05:39 1998
+++ xterm-81/ptyx.h Sun Jul 12 19:47:57 1998
@@ -266,6 +266,8 @@
#define HIGHLIGHT_BG 7
#define NCOLORS 8
+#define EXCHANGE(a,b,tmp) tmp = a; a = b; b = tmp;
+
#define COLOR_DEFINED(s,w) ((s)->which&(1<<(w)))
#define COLOR_VALUE(s,w) ((s)->colors[w])
#define SET_COLOR_VALUE(s,w,v) (((s)->colors[w]=(v)),((s)->which|=(1<<(w))))
Index: scrollbar.c
--- xterm-80+/scrollbar.c Sun Jul 5 16:05:39 1998
+++ xterm-81/scrollbar.c Tue Jul 14 20:19:28 1998
@@ -445,7 +445,7 @@
XtPointer client_data GCC_UNUSED,
XtPointer call_data)
{
- int pixels = (int) call_data;
+ long pixels = (long) call_data;
register TScreen *screen = &term->screen;
register int rowOnScreen, newTopLine;
@@ -491,7 +491,7 @@
return 0;
}
-static int
+static long
params_to_pixels (TScreen *screen, String *params, Cardinal n)
{
register int mult = 1;
@@ -532,8 +532,8 @@
{
if (IsXtermWidget(gw)) {
register TScreen *screen = &((XtermWidget)gw)->screen;
- ScrollTextUpDownBy (gw, (XtPointer) 0,
- (XtPointer)(params_to_pixels (screen, params, *nparams)));
+ long amount = params_to_pixels (screen, params, *nparams);
+ ScrollTextUpDownBy (gw, (XtPointer) 0, (XtPointer)amount);
}
return;
}
@@ -548,8 +548,8 @@
{
if (IsXtermWidget(gw)) {
register TScreen *screen = &((XtermWidget)gw)->screen;
- ScrollTextUpDownBy (gw, (XtPointer) 0,
- (XtPointer)(-params_to_pixels (screen, params, *nparams)));
+ long amount = -params_to_pixels (screen, params, *nparams);
+ ScrollTextUpDownBy (gw, (XtPointer) 0, (XtPointer)amount);
}
return;
}
Index: terminfo
--- xterm-80+/terminfo Sun Jul 5 16:05:39 1998
+++ xterm-81/terminfo Sun Jul 12 10:59:29 1998
@@ -367,7 +367,7 @@
kcuf1=\217C,
kcuu1=\217A,
kdch1=\2333~,
- kend=\2174~,
+ kend=\2334~,
kent=\217M,
kf1=\23311~,
kf10=\23321~,
@@ -390,7 +390,7 @@
kf8=\23319~,
kf9=\23320~,
kfnd=\2331~,
- khome=\2171~,
+ khome=\2331~,
kich1=\2332~,
kmous=\233M,
knp=\2336~,
Index: util.c
--- xterm-80+/util.c Sun Jul 5 16:05:39 1998
+++ xterm-81/util.c Sun Jul 12 19:48:09 1998
@@ -1196,8 +1196,6 @@
/***====================================================================***/
-#define EXCHANGE(a,b,tmp) tmp = a; a = b; b = tmp;
-
void
ReverseVideo (XtermWidget termw)
{
Index: version.h
--- xterm-80+/version.h Sun Jul 5 16:05:39 1998
+++ xterm-81/version.h Tue Jul 14 20:19:28 1998
@@ -6,4 +6,4 @@
* version of xterm has been built. The number in parentheses is my patch
* number (T.Dickey).
*/
-#define XTERM_VERSION "XFree86 3.9Ai(80)"
+#define XTERM_VERSION "XFree86 3.9Aj(81)"
Index: xterm.log.html
--- xterm-80+/xterm.log.html Sun Jul 5 16:05:39 1998
+++ xterm-81/xterm.log.html Tue Jul 14 20:34:23 1998
@@ -41,6 +41,7 @@
xc/programs/Xserver/hw/xfree86).
<UL>
+<LI><A HREF="#xterm_81">Patch #81 - 1998/7/14 - XFree86 3.9Aj</A>
<LI><A HREF="#xterm_80">Patch #80 - 1998/6/29 - XFree86 3.9Ai</A>
<LI><A HREF="#xterm_79">Patch #79 - 1998/6/28 - XFree86 3.9Ai</A>
<LI><A HREF="#xterm_78">Patch #78 - 1998/6/3 - XFree86 3.9Ah and 3.3.2</A>
@@ -122,6 +123,33 @@
<LI><A HREF="#xterm_02">Patch #2 - 1996/1/7</A>
<LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
</UL>
+
+<H1><A NAME="xterm_81">Patch #81 - 1998/7/14 - XFree86 3.9Aj</A></H1>
+More bug fixes:
+<ul>
+ <li>fix conflicting ifdef's for TIOCSLTC when building with Linux on
+ AXP aka DEC Alpha (reported by Robin Cutshaw).
+
+ <li>correction to patch #79, move assignment for *utptr->ut_user = 0;
+ back into non-SVR4 ifdef in main.c, since this clobbers username on
+ Solaris 2.5.1 (analysis by Will Day
+ <willday@rom.oit.gatech.edu>).
+
+ <li>corrected khome/kend in xterm-8bit terminfo description.
+
+ <li>improve cursor color by making it always the reverse of fg/bg
+ unless the cursorColor resource is set, i.e., to something other than
+ the default foreground (reported by Vikas Agnihotri and Bram
+ Moolenaar).
+
+ <li>minor fixes for compiler warnings, including a syntax error in
+ the AMOEBA ifdef's.
+</ul>
+From resync with XFree86 3.9Aj:
+<ul>
+ <li>correcton to patch #73, supply missing #else for fallback definitions
+ of size_t, time_t (Robin Cutshaw <robin@intercore.com>).
+</ul>
<H1><A NAME="xterm_80">Patch #80 - 1998/6/29 - XFree86 3.9Ai</A></H1>
This fixes a couple of items leftover or introduced by patch 79: