xterm 238. includes fix for CVE-2008-2383.

This commit is contained in:
matthieu 2009-01-06 20:10:20 +00:00
parent 32b6a0bc15
commit 7d6f399c75
27 changed files with 1164 additions and 757 deletions

View File

@ -1,6 +1,6 @@
-- $XTermId: INSTALL,v 1.117 2007/12/12 01:30:43 tom Exp $
-- $XTermId: INSTALL,v 1.118 2008/12/30 11:43:45 tom Exp $
-------------------------------------------------------------------------------
-- Copyright 1997-2006,2007 by Thomas E. Dickey
-- Copyright 1997-2007,2008 by Thomas E. Dickey
--
-- All Rights Reserved
--
@ -221,6 +221,13 @@ The options (in alphabetic order):
(The same ifdef controls the metaSendsEscape support).
--disable-paste64 disable support for bracketed paste mode
Do not compile-in code to support experimental bracketed paste mode,
i.e., provide functions for setting/getting the selection data.
(see ctlseqs.ms description of OSC 52).
--disable-pty-handshake disable support for pty handshakes
This feature is used to ensure that the child process's terminal modes
@ -272,10 +279,17 @@ The options (in alphabetic order):
--disable-tcap-fkeys disable termcap function-keys
Compile-in code to support feature which allows xterm to use the
Do not compile-in code to support feature which allows xterm to use the
function-key definitions from the termcap/terminfo entry which it used
to set the $TERM variable on startup.
--disable-tcap-query disable termcap query/report
Do not compile-in code to support DCS '+' control sequence, which
allows an application to ask xterm what control sequences it would
transmit for specified function keys, given the termcap or terminfo
names.
--disable-tek4014 disable tek4014 emulation
Do not compile-in code to support Tektronix 4014 emulation.
@ -399,13 +413,6 @@ The options (in alphabetic order):
configure --disable-imake --disable-narrowproto
--enable-paste64 enable support for bracketed paste mode
Compile-in code to support experimental bracketed paste mode, i.e.,
provide functions for setting/getting the selection data.
(see ctlseqs.ms description of OSC 52).
--enable-readline-mouse enable support for mouse in readline applications
Compile-in code to support experimental bracketed paste mode, i.e.,
@ -423,13 +430,6 @@ The options (in alphabetic order):
Compile-in code to support Sun-style function keys.
--enable-tcap-query enable termcap query/report
Compile-in code to support experimental DCS '+' control sequence, which
allows an application to ask xterm what control sequences it would
transmit for specified function keys, given the termcap or terminfo
names.
--enable-toolbar enable pulldown menus on toolbar
Compile-in code that builds a toolbar with pulldown menus. The

View File

@ -1,4 +1,4 @@
MANIFEST for xterm-237, version xterm-237
MANIFEST for xterm-238, version xterm-238
--------------------------------------------------------------------------------
MANIFEST this file
256colres.h resource-definitions for 256-color mode

15
app/xterm/aclocal.m4 vendored
View File

@ -1,4 +1,4 @@
dnl $XTermId: aclocal.m4,v 1.253 2008/07/27 15:28:15 tom Exp $
dnl $XTermId: aclocal.m4,v 1.254 2008/12/30 17:01:41 tom Exp $
dnl
dnl $XFree86: xc/programs/xterm/aclocal.m4,v 3.65 2006/06/19 00:36:50 dickey Exp $
dnl
@ -276,13 +276,14 @@ AC_TRY_LINK([#include <stdio.h>],[printf("Hello world");],,
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CHECK_ERRNO version: 9 updated: 2001/12/30 18:03:23
dnl CF_CHECK_ERRNO version: 10 updated: 2008/08/22 16:33:22
dnl --------------
dnl Check for data that is usually declared in <stdio.h> or <errno.h>, e.g.,
dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it
dnl ourselves.
dnl
dnl $1 = the name to check
dnl $2 = the assumed type
AC_DEFUN([CF_CHECK_ERRNO],
[
AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[
@ -293,7 +294,7 @@ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[
#include <stdio.h>
#include <sys/types.h>
#include <errno.h> ],
[long x = (long) $1],
ifelse($2,,int,$2) x = (ifelse($2,,int,$2)) $1,
[cf_cv_dcl_$1=yes],
[cf_cv_dcl_$1=no])
])
@ -304,7 +305,7 @@ if test "$cf_cv_dcl_$1" = no ; then
fi
# It's possible (for near-UNIX clones) that the data doesn't exist
CF_CHECK_EXTERN_DATA($1,int)
CF_CHECK_EXTERN_DATA($1,ifelse($2,,int,$2))
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23
@ -2320,7 +2321,7 @@ int x = XkbBI_Info
test "$cf_cv_xkb_bell_ext" = yes && AC_DEFINE(HAVE_XKB_BELL_EXT)
])
dnl ---------------------------------------------------------------------------
dnl CF_XOPEN_SOURCE version: 26 updated: 2008/07/27 11:26:57
dnl CF_XOPEN_SOURCE version: 28 updated: 2008/12/27 12:30:03
dnl ---------------
dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
dnl or adapt to the vendor's definitions to get equivalent functionality,
@ -2337,7 +2338,7 @@ cf_XOPEN_SOURCE=ifelse($1,,500,$1)
cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2)
case $host_os in #(vi
aix[[45]]*) #(vi
aix[[456]]*) #(vi
CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
;;
freebsd*|dragonfly*) #(vi
@ -2354,7 +2355,7 @@ hpux*) #(vi
irix[[56]].*) #(vi
CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
;;
linux*|gnu*|k*bsd*-gnu) #(vi
linux*|gnu*|mint*|k*bsd*-gnu) #(vi
CF_GNU_SOURCE
;;
mirbsd*) #(vi

View File

@ -1,4 +1,4 @@
/* $XTermId: button.c,v 1.288 2008/07/27 19:36:37 tom Exp $ */
/* $XTermId: button.c,v 1.297 2008/10/05 23:32:52 tom Exp $ */
/*
* Copyright 1999-2007,2008 by Thomas E. Dickey
@ -106,7 +106,8 @@ button.c Handles button events in the terminal emulator.
#define KeyModifiers (event->xbutton.state & OurModifiers)
#define KeyState(x) (((x) & (ShiftMask|ControlMask)) + (((x) & Mod1Mask) ? 2 : 0))
#define KeyState(x) (((int) ((x) & (ShiftMask|ControlMask))) \
+ (((x) & Mod1Mask) ? 2 : 0))
/* adds together the bits:
shift key -> 1
meta key -> 2
@ -204,6 +205,9 @@ SendMousePosition(XtermWidget xw, XEvent * event)
case BTN_EVENT_MOUSE:
case ANY_EVENT_MOUSE:
if (KeyModifiers == 0 || KeyModifiers == ControlMask) {
if (event->type == MotionNotify) {
((XButtonEvent *) event)->button = 0;
}
EditorButton(xw, (XButtonEvent *) event);
return True;
}
@ -249,7 +253,7 @@ SendLocatorPosition(XtermWidget xw, XEvent * event)
int row, col;
Bool oor;
int button;
int state;
unsigned state;
/* Make sure the event is an appropriate type */
if ((event->type != ButtonPress &&
@ -311,10 +315,10 @@ SendLocatorPosition(XtermWidget xw, XEvent * event)
reply.a_nparam = 4;
switch (event->type) {
case ButtonPress:
reply.a_param[0] = 2 + (button << 1);
reply.a_param[0] = (ParmType) (2 + (button << 1));
break;
case ButtonRelease:
reply.a_param[0] = 3 + (button << 1);
reply.a_param[0] = (ParmType) (3 + (button << 1));
break;
default:
return (True);
@ -333,9 +337,9 @@ SendLocatorPosition(XtermWidget xw, XEvent * event)
state ^= 1 << button; /* update mask to "after" state */
state = (state & ~(4 | 1)) | ((state & 1) ? 4 : 0) | ((state & 4) ? 1 : 0); /* swap Button1 & Button3 */
reply.a_param[1] = state;
reply.a_param[2] = row;
reply.a_param[3] = col;
reply.a_param[1] = (ParmType) state;
reply.a_param[2] = (ParmType) row;
reply.a_param[3] = (ParmType) col;
reply.a_inters = '&';
reply.a_final = 'w';
@ -425,9 +429,9 @@ GetLocatorPosition(XtermWidget xw)
reply.a_nparam = 4;
reply.a_param[0] = 1; /* Event - 1 = response to locator request */
reply.a_param[1] = state;
reply.a_param[2] = row;
reply.a_param[3] = col;
reply.a_param[1] = (ParmType) state;
reply.a_param[2] = (ParmType) row;
reply.a_param[3] = (ParmType) col;
reply.a_inters = '&';
reply.a_final = 'w';
unparseseq(xw, &reply);
@ -537,9 +541,9 @@ InitLocatorFilter(XtermWidget xw)
reply.a_type = ANSI_CSI;
reply.a_nparam = 4;
reply.a_param[0] = 10; /* Event - 10 = locator outside filter */
reply.a_param[1] = state;
reply.a_param[2] = row;
reply.a_param[3] = col;
reply.a_param[1] = (ParmType) state;
reply.a_param[2] = (ParmType) row;
reply.a_param[3] = (ParmType) col;
reply.a_inters = '&';
reply.a_final = 'w';
unparseseq(xw, &reply);
@ -594,9 +598,9 @@ CheckLocatorPosition(XtermWidget xw, XEvent * event)
reply.a_nparam = 4;
reply.a_param[0] = 10; /* Event - 10 = locator outside filter */
reply.a_param[1] = state;
reply.a_param[2] = row;
reply.a_param[3] = col;
reply.a_param[1] = (ParmType) state;
reply.a_param[2] = (ParmType) row;
reply.a_param[3] = (ParmType) col;
}
reply.a_inters = '&';
@ -807,9 +811,13 @@ DiredButton(Widget w,
Char Line[6];
unsigned line, col;
if (event->type == ButtonPress || event->type == ButtonRelease) {
line = (event->xbutton.y - screen->border) / FontHeight(screen);
col = (event->xbutton.x - OriginX(screen)) / FontWidth(screen);
if ((event->type == ButtonPress || event->type == ButtonRelease)
&& (event->xbutton.y >= screen->border)
&& (event->xbutton.x >= OriginX(screen))) {
line = ((unsigned) (event->xbutton.y - screen->border)
/ FontHeight(screen));
col = ((unsigned) (event->xbutton.x - OriginX(screen))
/ FontWidth(screen));
Line[0] = CONTROL('X');
Line[1] = ANSI_ESC;
Line[2] = 'G';
@ -1080,19 +1088,19 @@ UTF8toLatin1(Char * s, unsigned len, unsigned long *result)
} else {
unsigned eqv = ucs2dec(value);
if (xtermIsDecGraphic(eqv)) {
*q++ = DECtoASCII(eqv);
*q++ = (Char) DECtoASCII(eqv);
} else {
eqv = AsciiEquivs(value);
if (eqv == value)
eqv = '#';
*q++ = eqv;
*q++ = (Char) eqv;
if (iswide((wchar_t) value))
*q++ = ' ';
}
}
}
*q = 0;
*result = q - buffer;
*result = (unsigned long) (q - buffer);
} else {
*result = 0;
}
@ -1437,18 +1445,20 @@ _qWriteSelectionData(TScreen * screen, Char * lag, unsigned length)
switch (screen->base64_count) {
case 0:
buf[x++] = CharOf(base64_code[*p >> 2]);
screen->base64_accu = (*p & 0x3);
screen->base64_accu = (unsigned) (*p & 0x3);
screen->base64_count = 2;
++p;
break;
case 2:
buf[x++] = CharOf(base64_code[(screen->base64_accu << 4) + (*p >> 4)]);
screen->base64_accu = (*p & 0xF);
buf[x++] = CharOf(base64_code[(screen->base64_accu << 4) +
(*p >> 4)]);
screen->base64_accu = (unsigned) (*p & 0xF);
screen->base64_count = 4;
++p;
break;
case 4:
buf[x++] = CharOf(base64_code[(screen->base64_accu << 2) + (*p >> 6)]);
buf[x++] = CharOf(base64_code[(screen->base64_accu << 2) +
(*p >> 6)]);
buf[x++] = CharOf(base64_code[*p & 0x3F]);
screen->base64_accu = 0;
screen->base64_count = 0;
@ -1480,7 +1490,7 @@ _qWriteSelectionData(TScreen * screen, Char * lag, unsigned length)
}
static void
_WriteSelectionData(TScreen * screen, Char * line, int length)
_WriteSelectionData(TScreen * screen, Char * line, unsigned length)
{
/* Write data to pty a line at a time. */
/* Doing this one line at a time may no longer be necessary
@ -1634,7 +1644,7 @@ SelectionReceived(Widget w,
new_size += size + 1;
}
new_text_list =
(char **) XtMalloc(sizeof(char *) * text_list_count);
(char **) XtMalloc(sizeof(char *) * (unsigned) text_list_count);
new_text_list[0] = tmp = XtMalloc(new_size);
for (i = 0; i < text_list_count; ++i) {
data = (Char *) text_list[i];
@ -1678,7 +1688,7 @@ SelectionReceived(Widget w,
}
#endif
for (i = 0; i < text_list_count; i++) {
int len = strlen(text_list[i]);
unsigned len = strlen(text_list[i]);
_WriteSelectionData(screen, (Char *) text_list[i], len);
}
#if OPT_PASTE64
@ -2621,7 +2631,7 @@ do_select_regex(TScreen * screen, CELL * startc, CELL * endc)
firstRow,
size,
indexed)) != 0) {
int len = strlen(search);
int len = (int) strlen(search);
int col;
int best_col = -1;
int best_len = -1;
@ -3036,7 +3046,7 @@ SaltTextAway(XtermWidget xw,
TRACE(("Salted TEXT:%d:%s\n", lp - line,
visibleChars(PAIRED_CHARS(line, 0), (unsigned) (lp - line))));
screen->selection_length = (lp - line);
screen->selection_length = (unsigned long) (lp - line);
_OwnSelection(xw, params, num_params);
}
@ -3052,7 +3062,7 @@ static void
AppendStrToSelectionBuffer(TScreen * screen, Char * text, unsigned len)
{
if (len != 0) {
int j = screen->selection_length + len; /* New length */
int j = (int) (screen->selection_length + len); /* New length */
int k = j + (j >> 2) + 80; /* New size if we grow buffer: grow by ~50% */
if (j + 1 >= screen->selection_size) {
if (!screen->selection_length) {
@ -3081,7 +3091,7 @@ AppendStrToSelectionBuffer(TScreen * screen, Char * text, unsigned len)
void
AppendToSelectionBuffer(TScreen * screen, unsigned c)
{
int six;
unsigned six;
Char ch;
/* Decode base64 character */
@ -3167,6 +3177,29 @@ _ConvertSelectionHelper(Widget w,
return False;
}
static Boolean
SaveConvertedLength(XtPointer *target, unsigned long source)
{
Boolean result = False;
*target = XtMalloc(4);
if (*target != 0) {
result = True;
if (sizeof(unsigned long) == 4) {
*(unsigned long *) *target = source;
} else if (sizeof(unsigned) == 4) {
*(unsigned *) *target = source;
} else if (sizeof(unsigned short) == 4) {
*(unsigned short *) *target = (unsigned short) source;
} else {
/* FIXME - does this depend on byte-order? */
unsigned long temp = source;
memcpy((char *) *target, ((char *) &temp) + sizeof(temp) - 4, 4);
}
}
return result;
}
static Boolean
ConvertSelection(Widget w,
Atom * selection,
@ -3222,7 +3255,7 @@ ConvertSelection(Widget w,
*targetP++ = XA_LENGTH(dpy);
*targetP++ = XA_LIST_LENGTH(dpy);
*length = std_length + (targetP - allocP);
*length = std_length + (unsigned long) (targetP - allocP);
memcpy(targetP, std_targets, sizeof(Atom) * std_length);
XtFree((char *) std_targets);
@ -3303,31 +3336,17 @@ ConvertSelection(Widget w,
#endif
else if (*target == XA_LIST_LENGTH(dpy)) {
TRACE(("ConvertSelection XA_LIST_LENGTH(dpy)\n"));
*value = XtMalloc(4);
if (sizeof(long) == 4)
*(long *) *value = 1;
else {
long temp = 1;
memcpy((char *) *value, ((char *) &temp) + sizeof(long) - 4, 4);
}
result = SaveConvertedLength(value, 1);
*type = XA_INTEGER;
*length = 1;
*format = 32;
result = True;
} else if (*target == XA_LENGTH(dpy)) {
TRACE(("ConvertSelection XA_LENGTH(dpy)\n"));
/* This value is wrong if we have UTF-8 text */
*value = XtMalloc(4);
if (sizeof(long) == 4) {
*(long *) *value = screen->selection_length;
} else {
long temp = screen->selection_length;
memcpy((char *) *value, ((char *) &temp) + sizeof(long) - 4, 4);
}
result = SaveConvertedLength(value, screen->selection_length);
*type = XA_INTEGER;
*length = 1;
*format = 32;
result = True;
} else if (XmuConvertStandardSelection(w,
screen->selection_time, selection,
target, type, (XPointer *) value,
@ -3337,7 +3356,7 @@ ConvertSelection(Widget w,
}
/* else */
return result;
return (Boolean) result;
}
static void
@ -3396,7 +3415,7 @@ _OwnSelection(XtermWidget xw,
Cardinal i;
Bool have_selection = False;
if (screen->selection_length < 0)
if (screen->selection_length == 0)
return;
TRACE(("_OwnSelection\n"));
@ -3412,10 +3431,11 @@ _OwnSelection(XtermWidget xw,
for (i = 0; i < count; i++) {
int cutbuffer = CutBuffer(atoms[i]);
if (cutbuffer >= 0) {
if (screen->selection_length >
4 * XMaxRequestSize(XtDisplay((Widget) xw)) - 32) {
unsigned long limit =
(unsigned long) (4 * XMaxRequestSize(XtDisplay((Widget) xw)) - 32);
if (screen->selection_length > limit) {
fprintf(stderr,
"%s: selection too big (%d bytes), not storing in CUT_BUFFER%d\n",
"%s: selection too big (%ld bytes), not storing in CUT_BUFFER%d\n",
xterm_name, screen->selection_length, cutbuffer);
} else {
/* This used to just use the UTF-8 data, which was totally
@ -3536,7 +3556,7 @@ SaveText(TScreen * screen,
unsigned c;
Char *result = lp;
#if OPT_WIDE_CHARS
int previous = 0;
unsigned previous = 0;
#endif
i = Length(screen, row, scol, ecol);
@ -3554,7 +3574,7 @@ SaveText(TScreen * screen,
/* We want to strip out every occurrence of HIDDEN_CHAR AFTER a
* wide character.
*/
if (c == HIDDEN_CHAR && iswide(previous)) {
if (c == HIDDEN_CHAR && iswide((int) previous)) {
previous = c;
/* Combining characters attached to double-width characters
are in memory attached to the HIDDEN_CHAR */
@ -3624,7 +3644,7 @@ SaveText(TScreen * screen,
static Char
BtnCode(XButtonEvent * event, int button)
{
int result = 32 + (KeyState(event->state) << 2);
int result = (int) (32 + (KeyState(event->state) << 2));
if (button < 0 || button > 5) {
result += 3;
@ -3652,7 +3672,7 @@ EditorButton(XtermWidget xw, XButtonEvent * event)
Boolean changed = True;
/* If button event, get button # adjusted for DEC compatibility */
button = event->button - 1;
button = (int) (event->button - 1);
if (button >= 3)
button++;

View File

@ -1,4 +1,4 @@
/* $XTermId: cachedGCs.c,v 1.48 2008/02/20 20:54:54 Julien.Cristau Exp $ */
/* $XTermId: cachedGCs.c,v 1.49 2008/12/30 17:33:30 tom Exp $ */
/************************************************************
@ -396,16 +396,16 @@ newCache(XtermWidget xw, VTwin * cgsWin, CgsEnum cgsId, CgsCache * me)
static Boolean
HaveFont(XTermFonts * a)
{
return (a != 0 && a->fs != 0);
return (Boolean) (a != 0 && a->fs != 0);
}
static Boolean
SameFont(XTermFonts * a, XTermFonts * b)
{
return (HaveFont(a)
&& HaveFont(b)
&& ((a->fs == b->fs)
|| !memcmp(a->fs, b->fs, sizeof(*(a->fs)))));
return (Boolean) (HaveFont(a)
&& HaveFont(b)
&& ((a->fs == b->fs)
|| !memcmp(a->fs, b->fs, sizeof(*(a->fs)))));
}
#define SameColor(a,b) ((a) == (b))

View File

@ -1,4 +1,4 @@
/* $XTermId: charclass.c,v 1.20 2008/01/31 01:07:23 tom Exp $ */
/* $XTermId: charclass.c,v 1.21 2008/12/30 17:35:09 tom Exp $ */
/*
* Compact and efficient reimplementation of the
@ -51,7 +51,7 @@ SetCharacterClassRange(int low, int high, int value)
/* make sure we have at least one free entry left at table end */
if (classtab[0].last > classtab[0].cclass - 2) {
classtab[0].cclass += 5 + classtab[0].cclass / 4;
classtab = TypeRealloc(struct classentry, classtab[0].cclass, classtab);
classtab = TypeRealloc(struct classentry, (unsigned) classtab[0].cclass, classtab);
if (!classtab)
abort();
}

View File

@ -1,4 +1,4 @@
/* $XTermId: charproc.c,v 1.852 2008/09/14 21:27:54 tom Exp $ */
/* $XTermId: charproc.c,v 1.865 2008/12/30 14:45:41 tom Exp $ */
/*
@ -389,6 +389,8 @@ static XtActionsRec actionsList[] = {
static XtResource resources[] =
{
Bres(XtNallowSendEvents, XtCAllowSendEvents, screen.allowSendEvent0, False),
Bres(XtNallowFontOps, XtCAllowFontOps, screen.allowFontOp0, True),
Bres(XtNallowTcapOps, XtCAllowTcapOps, screen.allowTcapOp0, True),
Bres(XtNallowTitleOps, XtCAllowTitleOps, screen.allowTitleOp0, True),
Bres(XtNallowWindowOps, XtCAllowWindowOps, screen.allowWindowOp0, True),
Bres(XtNaltIsNotMeta, XtCAltIsNotMeta, screen.alt_is_not_meta, False),
@ -1236,8 +1238,8 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
WriteNow();
prev = XTERM_CELL(screen->last_written_row,
screen->last_written_col);
prev = (int) XTERM_CELL(screen->last_written_row,
screen->last_written_col);
precomposed = do_precomposition(prev, (int) c);
TRACE(("do_precomposition (U+%04X [%d], U+%04X [%d]) -> U+%04X [%d]\n",
prev, my_wcwidth(prev),
@ -1267,7 +1269,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
/* Intercept characters for printer controller mode */
if (screen->printer_controlmode == 2) {
if ((c = xtermPrinterControl((int) c)) == 0)
if ((c = (unsigned) xtermPrinterControl((int) c)) == 0)
continue;
}
@ -1279,7 +1281,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
#if OPT_VT52_MODE
if (sp->vt52_cup) {
if (nparam < NPARAM)
param[nparam++] = (c & 0x7f) - 32;
param[nparam++] = (int) (c & 0x7f) - 32;
if (nparam < 2)
continue;
sp->vt52_cup = False;
@ -1447,7 +1449,8 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
#endif
print_area = new_string;
print_size = new_length;
print_area[print_used++] = sp->lastchar = thischar = c;
print_area[print_used++] = c;
sp->lastchar = thischar = (int) c;
#if OPT_WIDE_CHARS
sp->last_was_wide = iswide((int) c);
#endif
@ -1486,7 +1489,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
#endif
string_area = new_string;
string_size = new_length;
string_area[string_used++] = c;
string_area[string_used++] = CharOf(c);
} else if (sp->parsestate != esc_table) {
/* if we were accumulating, we're not any more */
sp->string_mode = 0;
@ -1673,7 +1676,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
/* digit in csi or dec mode */
if ((row = param[nparam - 1]) == DEFAULT)
row = 0;
param[nparam - 1] = 10 * row + (c - '0');
param[nparam - 1] = (10 * row) + ((int) c - '0');
if (param[nparam - 1] > 65535)
param[nparam - 1] = 65535;
if (sp->parsestate == csi_table)
@ -1896,7 +1899,9 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
break;
}
} else {
reply.a_param[count++] = 60 + screen->terminal_id / 100;
reply.a_param[count++] = (ParmType) (60
+ screen->terminal_id
/ 100);
reply.a_param[count++] = 1; /* 132-columns */
reply.a_param[count++] = 2; /* printer */
reply.a_param[count++] = 6; /* selective-erase */
@ -1913,7 +1918,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
reply.a_param[count++] = 29; /* ANSI text locator */
#endif
}
reply.a_nparam = count;
reply.a_nparam = (ParmType) count;
reply.a_inters = 0;
reply.a_final = 'c';
unparseseq(xw, &reply);
@ -1934,7 +1939,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
reply.a_param[count++] = 0; /* VT100 (nonstandard) */
reply.a_param[count++] = XTERM_PATCH; /* Version */
reply.a_param[count++] = 0; /* options (none) */
reply.a_nparam = count;
reply.a_nparam = (ParmType) count;
reply.a_inters = 0;
reply.a_final = 'c';
unparseseq(xw, &reply);
@ -2177,7 +2182,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
TRACE(("CASE_CPR - cursor position\n"));
count = 0;
reply.a_type = ANSI_CSI;
reply.a_pintro = sp->private_function ? '?' : 0;
reply.a_pintro = CharOf(sp->private_function ? '?' : 0);
reply.a_inters = 0;
reply.a_final = 'n';
@ -2189,38 +2194,48 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
case 6:
/* CPR */
/* DECXCPR (with page=0) */
reply.a_param[count++] = screen->cur_row + 1;
reply.a_param[count++] = screen->cur_col + 1;
reply.a_param[count++] = (ParmType) (screen->cur_row + 1);
reply.a_param[count++] = (ParmType) (screen->cur_col + 1);
reply.a_final = 'R';
break;
case 15:
/* printer status */
reply.a_param[count++] = 13; /* implement printer */
if (screen->terminal_id >= 200) { /* VT220 */
reply.a_param[count++] = 13; /* implement printer */
}
break;
case 25:
/* UDK status */
reply.a_param[count++] = 20; /* UDK always unlocked */
if (screen->terminal_id >= 200) { /* VT220 */
reply.a_param[count++] = 20; /* UDK always unlocked */
}
break;
case 26:
/* keyboard status */
reply.a_param[count++] = 27;
reply.a_param[count++] = 1; /* North American */
if (screen->terminal_id >= 400) {
reply.a_param[count++] = 0; /* ready */
reply.a_param[count++] = 0; /* LK201 */
if (screen->terminal_id >= 200) { /* VT220 */
reply.a_param[count++] = 27;
reply.a_param[count++] = 1; /* North American */
if (screen->terminal_id >= 400) {
reply.a_param[count++] = 0; /* ready */
reply.a_param[count++] = 0; /* LK201 */
}
}
break;
case 53:
/* Locator status */
if (screen->terminal_id >= 200) { /* VT220 */
#if OPT_DEC_LOCATOR
reply.a_param[count++] = 50; /* locator ready */
reply.a_param[count++] = 50; /* locator ready */
#else
reply.a_param[count++] = 53; /* no locator */
reply.a_param[count++] = 53; /* no locator */
#endif
}
break;
default:
break;
}
if ((reply.a_nparam = count) != 0)
if ((reply.a_nparam = (ParmType) count) != 0)
unparseseq(xw, &reply);
sp->parsestate = sp->groundtable;
@ -2279,7 +2294,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
reply.a_type = ANSI_CSI;
reply.a_pintro = 0;
reply.a_nparam = 7;
reply.a_param[0] = row + 2;
reply.a_param[0] = (ParmType) (row + 2);
reply.a_param[1] = 1; /* no parity */
reply.a_param[2] = 1; /* eight bits */
reply.a_param[3] = 128; /* transmit 38.4k baud */
@ -2328,7 +2343,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
case CASE_GSETS:
TRACE(("CASE_GSETS(%d) = '%c'\n", sp->scstype, c));
if (screen->vtXX_level != 0)
screen->gsets[sp->scstype] = c;
screen->gsets[sp->scstype] = CharOf(c);
sp->parsestate = sp->groundtable;
break;
@ -2785,7 +2800,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
sp->groundtable[E2A(sp->lastchar)] == CASE_PRINT) {
IChar repeated[2];
count = (param[0] < 1) ? 1 : param[0];
repeated[0] = sp->lastchar;
repeated[0] = (IChar) sp->lastchar;
while (count-- > 0) {
dotext(xw,
screen->gsets[(int) (screen->curgl)],
@ -2907,8 +2922,8 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
} while (0);
#if OPT_WIDE_CHARS
screen->utf8_inparse = (screen->utf8_mode != uFalse
&& sp->parsestate != sos_table);
screen->utf8_inparse = (Boolean) ((screen->utf8_mode != uFalse)
&& (sp->parsestate != sos_table));
#endif
return True;
@ -3001,7 +3016,7 @@ v_write(int f, Char * data, unsigned len)
if (v_bufend < v_bufptr + len) {
/* still won't fit: get more space */
/* Don't use XtRealloc because an error is not fatal. */
int size = v_bufptr - v_buffer; /* save across realloc */
unsigned size = (unsigned) (v_bufptr - v_buffer);
v_buffer = TypeRealloc(Char, size + len, v_buffer);
if (v_buffer) {
#ifdef DEBUG
@ -3102,7 +3117,7 @@ v_write(int f, Char * data, unsigned len)
v_buffer = v_bufstr - start; /* restore clobbered pointer */
}
}
return (c);
return ((int) c);
}
#ifdef VMS
@ -3376,8 +3391,8 @@ PreeditPosition(TScreen * screen)
if (!screen->xic)
return;
spot.x = CurCursorX(screen, screen->cur_row, screen->cur_col);
spot.y = CursorY(screen, screen->cur_row) + screen->fs_ascent;
spot.x = (short) CurCursorX(screen, screen->cur_row, screen->cur_col);
spot.y = (short) (CursorY(screen, screen->cur_row) + screen->fs_ascent);
list = XVaCreateNestedList(0,
XNSpotLocation, &spot,
XNForeground, T_COLOR(screen, TEXT_FG),
@ -3445,12 +3460,12 @@ dotext(XtermWidget xw,
offset += chars_chomped) {
int width_available = MaxCols(screen) - screen->cur_col;
int width_here = 0;
int need_wrap = 0;
Boolean need_wrap = False;
int last_chomp = 0;
chars_chomped = 0;
if (screen->do_wrap) {
screen->do_wrap = 0;
screen->do_wrap = False;
if ((xw->flags & WRAPAROUND)) {
WrapLine(xw);
width_available = MaxCols(screen) - screen->cur_col;
@ -3474,12 +3489,12 @@ dotext(XtermWidget xw,
chars_chomped--;
width_here -= last_chomp;
if (chars_chomped > 0) {
need_wrap = 1;
need_wrap = True;
}
} else if (width_here == width_available) {
need_wrap = 1;
need_wrap = True;
} else if (chars_chomped != (len - offset)) {
need_wrap = 1;
need_wrap = True;
}
/*
@ -3537,7 +3552,7 @@ dotext(XtermWidget xw,
this_col = last_col - screen->cur_col + 1;
if (this_col <= 1) {
if (screen->do_wrap) {
screen->do_wrap = 0;
screen->do_wrap = False;
if ((xw->flags & WRAPAROUND)) {
WrapLine(xw);
}
@ -3570,7 +3585,7 @@ visual_width(PAIRED_CHARS(Char * str, Char * str2), Cardinal len)
{
/* returns the visual width of a string (doublewide characters count
as 2, normalwide characters count as 1) */
int my_len = 0;
unsigned my_len = 0;
while (len) {
int ch = *str;
if (str2)
@ -3673,9 +3688,9 @@ HandleStructNotify(Widget w GCC_UNUSED,
*/
REQ_RESIZE((Widget) xw,
screen->fullVwin.fullwidth,
info->menu_height
- save.menu_height
+ screen->fullVwin.fullheight,
(Dimension) (info->menu_height
- save.menu_height
+ screen->fullVwin.fullheight),
NULL, NULL);
repairSizeHints();
}
@ -3700,7 +3715,7 @@ HandleStructNotify(Widget w GCC_UNUSED,
#if OPT_BLINK_CURS
static void
SetCursorBlink(TScreen * screen, int enable)
SetCursorBlink(TScreen * screen, Boolean enable)
{
screen->cursor_blink = enable;
if (DoStartBlinking(screen)) {
@ -3716,7 +3731,7 @@ SetCursorBlink(TScreen * screen, int enable)
void
ToggleCursorBlink(TScreen * screen)
{
SetCursorBlink(screen, !(screen->cursor_blink));
SetCursorBlink(screen, (Boolean) (!(screen->cursor_blink)));
}
#endif
@ -3754,12 +3769,12 @@ ansi_modes(XtermWidget xw,
#define IsSM() (func == bitset)
#define set_bool_mode(flag) \
flag = (IsSM()) ? ON : OFF
flag = (Boolean) IsSM()
static void
really_set_mousemode(XtermWidget xw,
Bool enabled,
unsigned mode)
XtermMouseModes mode)
{
xw->screen.send_mouse_pos = enabled ? mode : MOUSE_OFF;
if (xw->screen.send_mouse_pos != MOUSE_OFF)
@ -3784,6 +3799,7 @@ dpmodes(XtermWidget xw,
{
TScreen *screen = &xw->screen;
int i, j;
unsigned myflags;
for (i = 0; i < nparam; ++i) {
TRACE(("%s %d\n", IsSM()? "DECSET" : "DECRST", param[i]));
@ -3838,9 +3854,9 @@ dpmodes(XtermWidget xw,
update_jumpscroll();
break;
case 5: /* DECSCNM */
j = xw->flags;
myflags = xw->flags;
(*func) (&xw->flags, REVERSE_VIDEO);
if ((xw->flags ^ j) & REVERSE_VIDEO)
if ((xw->flags ^ myflags) & REVERSE_VIDEO)
ReverseVideo(xw);
/* update_reversevideo done in RevVid */
break;
@ -4302,7 +4318,7 @@ restoremodes(XtermWidget xw)
/* ignore autorepeat */
break;
case SET_X10_MOUSE: /* MIT bogus sequence */
DoRM(DP_X_X10MSE, screen->send_mouse_pos);
DoRM0(DP_X_X10MSE, screen->send_mouse_pos);
break;
#if OPT_TOOLBAR
case 10: /* rxvt */
@ -4374,7 +4390,7 @@ restoremodes(XtermWidget xw)
case SET_VT200_HIGHLIGHT_MOUSE:
case SET_BTN_EVENT_MOUSE:
case SET_ANY_EVENT_MOUSE:
DoRM(DP_X_MOUSE, screen->send_mouse_pos);
DoRM0(DP_X_MOUSE, screen->send_mouse_pos);
break;
#if OPT_FOCUS_EVENT
case SET_FOCUS_EVENT_MOUSE:
@ -4521,7 +4537,9 @@ window_ops(XtermWidget xw)
reply.a_type = ANSI_CSI;
reply.a_pintro = 0;
reply.a_nparam = 1;
reply.a_param[0] = (win_attrs.map_state == IsViewable) ? 1 : 2;
reply.a_param[0] = (ParmType) ((win_attrs.map_state == IsViewable)
? 1
: 2);
reply.a_inters = 0;
reply.a_final = 't';
unparseseq(xw, &reply);
@ -4535,8 +4553,8 @@ window_ops(XtermWidget xw)
reply.a_pintro = 0;
reply.a_nparam = 3;
reply.a_param[0] = 3;
reply.a_param[1] = win_attrs.x;
reply.a_param[2] = win_attrs.y;
reply.a_param[1] = (ParmType) win_attrs.x;
reply.a_param[2] = (ParmType) win_attrs.y;
reply.a_inters = 0;
reply.a_final = 't';
unparseseq(xw, &reply);
@ -4554,8 +4572,8 @@ window_ops(XtermWidget xw)
* win_attrs.height or Height
* win_attrs.width or Width
*/
reply.a_param[1] = Height(screen);
reply.a_param[2] = Width(screen);
reply.a_param[1] = (ParmType) Height(screen);
reply.a_param[2] = (ParmType) Width(screen);
reply.a_inters = 0;
reply.a_final = 't';
unparseseq(xw, &reply);
@ -4566,8 +4584,8 @@ window_ops(XtermWidget xw)
reply.a_pintro = 0;
reply.a_nparam = 3;
reply.a_param[0] = 8;
reply.a_param[1] = MaxRows(screen);
reply.a_param[2] = MaxCols(screen);
reply.a_param[1] = (ParmType) MaxRows(screen);
reply.a_param[2] = (ParmType) MaxCols(screen);
reply.a_inters = 0;
reply.a_final = 't';
unparseseq(xw, &reply);
@ -4583,8 +4601,8 @@ window_ops(XtermWidget xw)
reply.a_pintro = 0;
reply.a_nparam = 3;
reply.a_param[0] = 9;
reply.a_param[1] = root_height / FontHeight(screen);
reply.a_param[2] = root_width / FontWidth(screen);
reply.a_param[1] = (ParmType) (root_height / FontHeight(screen));
reply.a_param[2] = (ParmType) (root_width / FontWidth(screen));
reply.a_inters = 0;
reply.a_final = 't';
unparseseq(xw, &reply);
@ -4721,11 +4739,11 @@ unparseputc(XtermWidget xw, int c)
if (xw->screen.tc_query_code >= 0) {
char tmp[3];
sprintf(tmp, "%02X", c & 0xFF);
buf[len++] = tmp[0];
buf[len++] = tmp[1];
buf[len++] = CharOf(tmp[0]);
buf[len++] = CharOf(tmp[1]);
} else
#endif
if ((buf[len++] = c) == '\r' && (xw->flags & LINEFEED)) {
if ((buf[len++] = (IChar) c) == '\r' && (xw->flags & LINEFEED)) {
buf[len++] = '\n';
}
@ -4810,7 +4828,7 @@ SwitchBufs(XtermWidget xw)
(int) OriginX(screen),
(int) top * FontHeight(screen) + screen->border,
(unsigned) Width(screen),
(unsigned) (rows - top) * FontHeight(screen),
(unsigned) ((rows - top) * FontHeight(screen)),
False);
}
ScrnUpdate(xw, 0, 0, rows, MaxCols(screen), False);
@ -4943,7 +4961,8 @@ VTResize(Widget w)
}
}
#define okDimension(src,dst) ((src <= 32767) && ((dst = src) == src))
#define okDimension(src,dst) ((src <= 32767) \
&& ((dst = (Dimension) src) == src))
static void
RequestResize(XtermWidget xw, int rows, int cols, Bool text)
@ -4957,8 +4976,8 @@ RequestResize(XtermWidget xw, int rows, int cols, Bool text)
TRACE(("RequestResize(rows=%d, cols=%d, text=%d)\n", rows, cols, text));
if ((askedWidth = cols) < cols
|| (askedHeight = rows) < rows)
if ((askedWidth = (Dimension) cols) < cols
|| (askedHeight = (Dimension) rows) < rows)
return;
if (askedHeight == 0
@ -4969,20 +4988,21 @@ RequestResize(XtermWidget xw, int rows, int cols, Bool text)
}
if (text) {
if ((value = rows) != 0) {
if ((value = (unsigned long) rows) != 0) {
if (rows < 0)
value = MaxRows(screen);
value *= FontHeight(screen);
value += (2 * screen->border);
value = (unsigned long) MaxRows(screen);
value *= (unsigned long) FontHeight(screen);
value += (unsigned long) (2 * screen->border);
if (!okDimension(value, askedHeight))
return;
}
if ((value = cols) != 0) {
if ((value = (unsigned long) cols) != 0) {
if (cols < 0)
value = MaxCols(screen);
value *= FontWidth(screen);
value += (2 * screen->border) + ScrollbarWidth(screen);
value = (unsigned long) MaxCols(screen);
value *= (unsigned long) FontWidth(screen);
value += (unsigned long) ((2 * screen->border)
+ ScrollbarWidth(screen));
if (!okDimension(value, askedWidth))
return;
}
@ -4995,19 +5015,19 @@ RequestResize(XtermWidget xw, int rows, int cols, Bool text)
}
if (rows == 0)
askedHeight = attrs.height;
askedHeight = (Dimension) attrs.height;
if (cols == 0)
askedWidth = attrs.width;
askedWidth = (Dimension) attrs.width;
if (xw->misc.limit_resize > 0) {
Dimension high = xw->misc.limit_resize * attrs.height;
Dimension wide = xw->misc.limit_resize * attrs.width;
Dimension high = (Dimension) (xw->misc.limit_resize * attrs.height);
Dimension wide = (Dimension) (xw->misc.limit_resize * attrs.width);
if (high < attrs.height)
high = attrs.height;
high = (Dimension) attrs.height;
if (askedHeight > high)
askedHeight = high;
if (wide < attrs.width)
wide = attrs.width;
wide = (Dimension) attrs.width;
if (askedWidth > wide)
askedWidth = wide;
}
@ -5212,7 +5232,7 @@ VTInitialize_locale(XtermWidget request)
#if OPT_MINI_LUIT
if (x_strcasecmp(request->misc.locale_str, "CHECKFONT") == 0) {
int fl = (request->misc.default_font.f_n
? strlen(request->misc.default_font.f_n)
? (int) strlen(request->misc.default_font.f_n)
: 0);
if (fl > 11
&& x_strcasecmp(request->misc.default_font.f_n + fl - 11,
@ -5229,7 +5249,7 @@ VTInitialize_locale(XtermWidget request)
request->screen.utf8_mode = uFalse;
request->screen.latin9_mode = 1;
} else {
request->misc.callfilter = is_utf8 ? 0 : 1;
request->misc.callfilter = (Boolean) (is_utf8 ? 0 : 1);
request->screen.utf8_mode = uAlways;
}
#else
@ -5250,7 +5270,7 @@ VTInitialize_locale(XtermWidget request)
x_strcasecmp(request->misc.locale_str, "AUTO") == 0 ||
strcmp(request->misc.locale_str, "1") == 0) {
/* when true ... fully obeying LC_CTYPE locale */
request->misc.callfilter = is_utf8 ? 0 : 1;
request->misc.callfilter = (Boolean) (is_utf8 ? 0 : 1);
request->screen.utf8_mode = uAlways;
} else if (x_strcasecmp(request->misc.locale_str, "FALSE") == 0 ||
x_strcasecmp(request->misc.locale_str, "OFF") == 0 ||
@ -5298,7 +5318,7 @@ VTInitialize_locale(XtermWidget request)
}
#endif /* OPT_LUIT_PROG */
request->screen.utf8_inparse = (request->screen.utf8_mode != uFalse);
request->screen.utf8_inparse = (Boolean) (request->screen.utf8_mode != uFalse);
TRACE(("... updated screen.utf8_mode = %d\n", request->screen.utf8_mode));
TRACE(("...VTInitialize_locale done\n"));
@ -5561,11 +5581,15 @@ VTInitialize(Widget wrequest,
init_Bres(screen.meta_sends_esc);
init_Bres(screen.allowSendEvent0);
init_Bres(screen.allowFontOp0);
init_Bres(screen.allowTcapOp0);
init_Bres(screen.allowTitleOp0);
init_Bres(screen.allowWindowOp0);
/* make a copy so that editres cannot change the resource after startup */
wnew->screen.allowSendEvents = wnew->screen.allowSendEvent0;
wnew->screen.allowFontOps = wnew->screen.allowFontOp0;
wnew->screen.allowTcapOps = wnew->screen.allowTcapOp0;
wnew->screen.allowTitleOps = wnew->screen.allowTitleOp0;
wnew->screen.allowWindowOps = wnew->screen.allowWindowOp0;
@ -6034,8 +6058,10 @@ VTDestroy(Widget w GCC_UNUSED)
StopBlinking(screen);
if (screen->scrollWidget)
if (screen->scrollWidget) {
XtUninstallTranslations(screen->scrollWidget);
XtDestroyWidget(screen->scrollWidget);
}
TRACE_FREE_LEAK(screen->save_ptr);
TRACE_FREE_LEAK(screen->sbuf_address);
@ -6063,7 +6089,6 @@ VTDestroy(Widget w GCC_UNUSED)
releaseWindowGCs(xw, &(screen->iconVwin));
#endif
XtUninstallTranslations((Widget) xw);
XtUninstallTranslations(screen->scrollWidget);
#if OPT_TOOLBAR
XtUninstallTranslations((Widget) XtParent(xw));
#endif
@ -6213,12 +6238,14 @@ VTRealize(Widget w,
BorderWidth(SHELL_OF(xw))));
if ((pr & XValue) && (XNegative & pr)) {
xpos += DisplayWidth(screen->display, DefaultScreen(screen->display))
- width - (BorderWidth(XtParent(xw)) * 2);
xpos += (DisplayWidth(screen->display, DefaultScreen(screen->display))
- (int) width
- (BorderWidth(XtParent(xw)) * 2));
}
if ((pr & YValue) && (YNegative & pr)) {
ypos += DisplayHeight(screen->display, DefaultScreen(screen->display))
- height - (BorderWidth(XtParent(xw)) * 2);
ypos += (DisplayHeight(screen->display, DefaultScreen(screen->display))
- (int) height
- (BorderWidth(XtParent(xw)) * 2));
}
/* set up size hints for window manager; min 1 char by 1 char */
@ -6406,14 +6433,14 @@ VTRealize(Widget w,
#endif
screen->visbuf = screen->allbuf = NULL;
screen->do_wrap = 0;
screen->do_wrap = False;
screen->scrolls = screen->incopy = 0;
xtermSetCursorBox(screen);
screen->savedlines = 0;
for (i = 0; i < 2; ++i) {
screen->alternate = !screen->alternate;
screen->alternate = (Boolean) (!screen->alternate);
CursorSave(xw);
}
@ -6638,7 +6665,7 @@ xim_real_init(void)
return;
}
(void) XExtentsOfFontSet(term->screen.fs);
j = XFontsOfFontSet(term->screen.fs, &fonts, &font_name_list);
j = (unsigned) XFontsOfFontSet(term->screen.fs, &fonts, &font_name_list);
for (i = 0, term->screen.fs_ascent = 0; i < j; i++) {
if (term->screen.fs_ascent < (*fonts)->ascent)
term->screen.fs_ascent = (*fonts)->ascent;
@ -6704,8 +6731,8 @@ VTSetValues(Widget cur,
{
XtermWidget curvt = (XtermWidget) cur;
XtermWidget newvt = (XtermWidget) wnew;
Bool refresh_needed = False;
Bool fonts_redone = False;
Boolean refresh_needed = False;
Boolean fonts_redone = False;
if ((T_COLOR(&(curvt->screen), TEXT_BG) !=
T_COLOR(&(newvt->screen), TEXT_BG)) ||
@ -6734,7 +6761,8 @@ VTSetValues(Widget cur,
if (curvt->misc.re_verse != newvt->misc.re_verse) {
newvt->flags ^= REVERSE_VIDEO;
ReverseVideo(newvt);
newvt->misc.re_verse = !newvt->misc.re_verse; /* ReverseVideo toggles */
/* ReverseVideo toggles */
newvt->misc.re_verse = (Boolean) (!newvt->misc.re_verse);
refresh_needed = True;
}
if ((T_COLOR(&(curvt->screen), MOUSE_FG) !=
@ -6871,8 +6899,7 @@ ShowCursor(void)
*/
(void) fg_bg;
if_OPT_EXT_COLORS(screen, {
fg_bg = (SCRN_BUF_FGRND(screen, screen->cursorp.row)[cursor_col] << 8)
| (SCRN_BUF_BGRND(screen, screen->cursorp.row)[cursor_col]);
fg_bg = PACK_FGBG(screen, screen->cursorp.row, cursor_col);
});
if_OPT_ISO_TRADITIONAL_COLORS(screen, {
fg_bg = SCRN_BUF_COLOR(screen, screen->cursorp.row)[cursor_col];
@ -7011,11 +7038,11 @@ ShowCursor(void)
if (outlineGC == 0)
outlineGC = currentGC;
screen->box->x = x;
screen->box->x = (short) x;
if (!screen->cursor_underline)
screen->box->y = y;
screen->box->y = (short) y;
else
screen->box->y = y + FontHeight(screen) - 2;
screen->box->y = (short) (y + FontHeight(screen) - 2);
XDrawLines(screen->display, VWindow(screen), outlineGC,
screen->box, NBOX, CoordModePrevious);
}
@ -7082,8 +7109,7 @@ HideCursor(void)
});
if_OPT_EXT_COLORS(screen, {
fg_bg = (SCRN_BUF_FGRND(screen, screen->cursorp.row)[cursor_col] << 8)
| (SCRN_BUF_BGRND(screen, screen->cursorp.row)[cursor_col]);
fg_bg = PACK_FGBG(screen, screen->cursorp.row, cursor_col);
});
if_OPT_ISO_TRADITIONAL_COLORS(screen, {
fg_bg = SCRN_BUF_COLOR(screen, screen->cursorp.row)[cursor_col];
@ -7135,8 +7161,9 @@ static void
StartBlinking(TScreen * screen)
{
if (screen->blink_timer == 0) {
unsigned long interval = (screen->cursor_state == ON ?
screen->blink_on : screen->blink_off);
unsigned long interval = (unsigned long) ((screen->cursor_state == ON)
? screen->blink_on
: screen->blink_off);
if (interval == 0) /* wow! */
interval = 1; /* let's humor him anyway */
screen->blink_timer = XtAppAddTimeOut(app_con,
@ -7341,14 +7368,16 @@ VTReset(XtermWidget xw, Bool full, Bool saved)
update_reversewrap();
update_autolinefeed();
screen->jumpscroll = !(xw->flags & SMOOTHSCROLL);
screen->jumpscroll = (Boolean) (!(xw->flags & SMOOTHSCROLL));
update_jumpscroll();
if (screen->c132 && (xw->flags & IN132COLUMNS)) {
Dimension reqWidth = (80 * FontWidth(screen)
+ 2 * screen->border + ScrollbarWidth(screen));
Dimension reqHeight = (FontHeight(screen)
* MaxRows(screen) + 2 * screen->border);
Dimension reqWidth = (Dimension) (80 * FontWidth(screen)
+ 2 * screen->border
+ ScrollbarWidth(screen));
Dimension reqHeight = (Dimension) (FontHeight(screen)
* MaxRows(screen)
+ 2 * screen->border);
Dimension replyWidth;
Dimension replyHeight;
@ -7414,9 +7443,9 @@ set_character_class(char *s)
base = 10; /* in case we ever add octal, hex */
low = high = -1; /* out of range */
for (i = 0, len = strlen(s), acc = 0, numbers = digits = 0;
for (i = 0, len = (int) strlen(s), acc = 0, numbers = digits = 0;
i < len; i++) {
Char c = s[i];
Char c = CharOf(s[i]);
if (isspace(c)) {
continue;
@ -7535,7 +7564,7 @@ HandleKeymapChange(Widget w,
(void) sprintf(pmapName, "%sKeymap", params[0]);
(void) strcpy(pmapClass, pmapName);
if (islower(CharOf(pmapClass[0])))
pmapClass[0] = toupper(CharOf(pmapClass[0]));
pmapClass[0] = x_toupper(pmapClass[0]);
XtGetSubresources(w, (XtPointer) &keymap, pmapName, pmapClass,
key_resources, (Cardinal) 1, NULL, (Cardinal) 0);
if (keymap != NULL)
@ -7655,9 +7684,9 @@ void
FindFontSelection(XtermWidget xw, const char *atom_name, Bool justprobe)
{
static AtomPtr *atoms;
static int atomCount = 0;
unsigned int atomCount = 0;
AtomPtr *pAtom;
int a;
unsigned a;
Atom target;
if (!atom_name)

923
app/xterm/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
dnl $XTermId: configure.in,v 1.245 2008/07/27 15:03:56 tom Exp $
dnl $XTermId: configure.in,v 1.246 2008/12/30 11:30:48 tom Exp $
dnl
dnl ---------------------------------------------------------------------------
dnl
@ -644,10 +644,10 @@ test "$enable_numlock" = no && AC_DEFINE(OPT_NUM_LOCK,0)
AC_MSG_CHECKING(if you want support for get/set of base64 selection data)
CF_ARG_ENABLE(paste64,
[ --enable-paste64 enable get/set base64 selection data],
[enable_paste64=yes],
[enable_paste64=no])
CF_ARG_DISABLE(paste64,
[ --disable-paste64 disable get/set base64 selection data],
[enable_paste64=no],
[enable_paste64=yes])
AC_MSG_RESULT($enable_paste64)
if test "$enable_paste64" = yes ; then
AC_DEFINE(OPT_PASTE64,1)
@ -730,10 +730,10 @@ AC_MSG_RESULT($enable_tcap_fkeys)
test "$enable_tcap_fkeys" = yes && AC_DEFINE(OPT_TCAP_FKEYS,1)
AC_MSG_CHECKING(if you want to use termcap-query/report)
CF_ARG_ENABLE(tcap-query,
[ --enable-tcap-query compile-in termcap-query support],
[enable_tcap_query=yes],
[enable_tcap_query=no])
CF_ARG_DISABLE(tcap-query,
[ --disable-tcap-query disable compiled-in termcap-query support],
[enable_tcap_query=no],
[enable_tcap_query=yes])
AC_MSG_RESULT($enable_tcap_query)
test "$enable_tcap_query" = yes && AC_DEFINE(OPT_TCAP_QUERY,1)

View File

@ -1,4 +1,4 @@
/* $XTermId: cursor.c,v 1.45 2008/04/20 21:06:22 tom Exp $ */
/* $XTermId: cursor.c,v 1.46 2008/10/05 20:12:16 tom Exp $ */
/* $XFree86: xc/programs/xterm/cursor.c,v 3.20 2006/02/13 01:14:58 dickey Exp $ */
@ -81,7 +81,7 @@ CursorSet(TScreen * screen, int row, int col, unsigned flags)
}
use_row = (use_row < 0 ? 0 : use_row);
set_cur_row(screen, (use_row <= max_row ? use_row : max_row));
screen->do_wrap = 0;
screen->do_wrap = False;
TRACE(("CursorSet(%d,%d) margins [%d..%d] -> %d,%d %s\n",
row, col,
@ -119,7 +119,7 @@ CursorBack(XtermWidget xw, int n)
set_cur_col(screen, 0);
}
}
screen->do_wrap = 0;
screen->do_wrap = False;
}
/*
@ -135,7 +135,7 @@ CursorForward(TScreen * screen, int n)
next = max;
set_cur_col(screen, next);
screen->do_wrap = 0;
screen->do_wrap = False;
}
/*
@ -156,7 +156,7 @@ CursorDown(TScreen * screen, int n)
next = screen->max_row;
set_cur_row(screen, next);
screen->do_wrap = 0;
screen->do_wrap = False;
}
/*
@ -178,7 +178,7 @@ CursorUp(TScreen * screen, int n)
next = 0;
set_cur_row(screen, next);
screen->do_wrap = 0;
screen->do_wrap = False;
}
/*
@ -236,7 +236,7 @@ void
CarriageReturn(TScreen * screen)
{
set_cur_col(screen, 0);
screen->do_wrap = 0;
screen->do_wrap = False;
do_xevents();
}

View File

@ -1,4 +1,4 @@
/* $XTermId: fontutils.c,v 1.275 2008/09/14 22:21:14 tom Exp $ */
/* $XTermId: fontutils.c,v 1.278 2008/12/30 17:32:06 tom Exp $ */
/************************************************************
@ -119,7 +119,7 @@ static void lookupOneFontSize(XtermWidget, int);
#endif
#if OPT_WIDE_CHARS
static Bool
static unsigned
countGlyphs(XFontStruct * fp)
{
unsigned count = 0;
@ -505,8 +505,8 @@ same_font_name(char *pattern, char *match)
return False;
}
} else {
int p = char2lower(*pattern++);
int m = char2lower(*match++);
int p = x_toupper(*pattern++);
int m = x_toupper(*match++);
if (p != m)
return False;
}
@ -1301,9 +1301,8 @@ HandleLoadVTFonts(Widget w,
TRACE(("HandleLoadVTFonts(%d)\n", *param_count));
strcpy(myClass, convert);
if (*param_count == 1
&& islower(CharOf(myClass[0])))
myClass[0] = toupper(CharOf(myClass[0]));
if (*param_count == 1)
myClass[0] = x_toupper(myClass[0]);
if (xtermLoadVTFonts(xw, myName, myClass)) {
/*
@ -1340,10 +1339,10 @@ xtermSetCursorBox(TScreen * screen)
int hh = screen->cursor_underline ? 1 : fh;
vp = &VTbox[1];
(vp++)->x = fw;
(vp++)->y = hh;
(vp++)->x = -fw;
vp->y = -hh;
(vp++)->x = (short) fw;
(vp++)->y = (short) hh;
(vp++)->x = (short) -fw;
vp->y = (short) -hh;
screen->box = VTbox;
}
@ -2150,7 +2149,7 @@ xtermDrawBoxChar(XtermWidget xw,
360 * 64);
} else if (ch < (sizeof(lines) / sizeof(lines[0]))
&& (p = lines[ch]) != 0) {
int coord[4];
unsigned coord[4];
int n = 0;
while (*p >= 0) {
coord[n++] = *p++;

View File

@ -1,4 +1,4 @@
/* $XTermId: input.c,v 1.300 2008/09/14 16:37:25 Ted.Phelps Exp $ */
/* $XTermId: input.c,v 1.302 2008/12/30 17:20:39 tom Exp $ */
/*
* Copyright 1999-2007,2008 by Thomas E. Dickey
@ -82,6 +82,7 @@
#include <data.h>
#include <fontutils.h>
#include <xstrings.h>
#include <xtermcap.h>
/*
@ -825,7 +826,7 @@ Input(XtermWidget xw,
kd.is_fkey = False;
#if OPT_TCAP_QUERY
if (screen->tc_query_code >= 0) {
kd.keysym = screen->tc_query_code;
kd.keysym = (KeySym) screen->tc_query_code;
kd.is_fkey = screen->tc_query_fkey;
if (kd.keysym != XK_BackSpace) {
kd.nbytes = 0;
@ -862,7 +863,7 @@ Input(XtermWidget xw,
&& (keyboard->modify_now.other_keys > 1)
&& !IsControlInput(&kd)) {
kd.nbytes = 1;
kd.strbuf[0] = kd.keysym;
kd.strbuf[0] = (char) kd.keysym;
}
#endif /* OPT_MOD_FKEYS */
} else
@ -983,7 +984,7 @@ Input(XtermWidget xw,
#ifdef XK_KP_Home
if (kd.keysym >= XK_KP_Home && kd.keysym <= XK_KP_Begin) {
TRACE(("...Input keypad before was " KEYSYM_FMT "\n", kd.keysym));
kd.keysym += XK_Home - XK_KP_Home;
kd.keysym += (unsigned) (XK_Home - XK_KP_Home);
TRACE(("...Input keypad changed to " KEYSYM_FMT "\n", kd.keysym));
}
#endif
@ -1028,7 +1029,7 @@ Input(XtermWidget xw,
TRACE(("...map XK_F%ld", kd.keysym - XK_Fn(1) + 1));
if (evt_state & ControlMask) {
kd.keysym += xw->misc.ctrl_fkeys;
kd.keysym += (KeySym) xw->misc.ctrl_fkeys;
evt_state &= ~ControlMask;
}
TRACE((" to XK_F%ld\n", kd.keysym - XK_Fn(1) + 1));
@ -1039,11 +1040,11 @@ Input(XtermWidget xw,
TRACE(("...map XK_F%ld", kd.keysym - XK_Fn(1) + 1));
if (evt_state & ShiftMask) {
kd.keysym += xw->misc.ctrl_fkeys * 1;
kd.keysym += (KeySym) (xw->misc.ctrl_fkeys * 1);
evt_state &= ~ShiftMask;
}
if (evt_state & ControlMask) {
kd.keysym += xw->misc.ctrl_fkeys * 2;
kd.keysym += (KeySym) (xw->misc.ctrl_fkeys * 2);
evt_state &= ~ControlMask;
}
TRACE((" to XK_F%ld\n", kd.keysym - XK_Fn(1) + 1));
@ -1124,7 +1125,7 @@ Input(XtermWidget xw,
&& (dec_code >= 11 && dec_code <= 14)) {
reply.a_type = ANSI_SS3;
VT52_CURSOR_KEYS;
reply.a_final = A2E(dec_code - 11 + E2A('P'));
reply.a_final = (Char) A2E(dec_code - 11 + E2A('P'));
modifyCursorKey(&reply,
keyboard->modify_now.function_keys,
&modify_parm);
@ -1167,7 +1168,7 @@ Input(XtermWidget xw,
key = True;
} else if (IsPFKey(kd.keysym)) {
reply.a_type = ANSI_SS3;
reply.a_final = kd.keysym - XK_KP_F1 + 'P';
reply.a_final = (Char) ((kd.keysym - XK_KP_F1) + 'P');
VT52_CURSOR_KEYS;
MODIFIER_PARM;
unparseseq(xw, &reply);
@ -1175,7 +1176,7 @@ Input(XtermWidget xw,
} else if (IsKeypadKey(kd.keysym)) {
if (keypad_mode) {
reply.a_type = ANSI_SS3;
reply.a_final = kypd_apl[kd.keysym - XK_KP_Space];
reply.a_final = (Char) (kypd_apl[kd.keysym - XK_KP_Space]);
VT52_KEYPAD;
MODIFIER_PARM;
unparseseq(xw, &reply);
@ -1190,7 +1191,7 @@ Input(XtermWidget xw,
reply.a_type = ANSI_CSI;
}
modifyCursorKey(&reply, keyboard->modify_now.cursor_keys, &modify_parm);
reply.a_final = curfinal[kd.keysym - XK_Home];
reply.a_final = (Char) (curfinal[kd.keysym - XK_Home]);
VT52_CURSOR_KEYS;
MODIFIER_PARM;
unparseseq(xw, &reply);
@ -1286,7 +1287,7 @@ Input(XtermWidget xw,
if (eightbit && (kd.nbytes == 1) && screen->input_eight_bits) {
IChar ch = CharOf(kd.strbuf[0]);
if (ch < 128) {
kd.strbuf[0] |= 0x80;
kd.strbuf[0] |= (char) 0x80;
TRACE(("...input shift from %d to %d (%#x to %#x)\n",
ch, CharOf(kd.strbuf[0]),
ch, CharOf(kd.strbuf[0])));
@ -1299,8 +1300,8 @@ Input(XtermWidget xw,
*/
ch = CharOf(kd.strbuf[0]);
kd.nbytes = 2;
kd.strbuf[0] = 0xc0 | ((ch >> 6) & 0x3);
kd.strbuf[1] = 0x80 | (ch & 0x3f);
kd.strbuf[0] = (char) (0xc0 | ((ch >> 6) & 0x3));
kd.strbuf[1] = (char) (0x80 | (ch & 0x3f));
TRACE(("...encoded %#x in UTF-8 as %#x,%#x\n",
ch, CharOf(kd.strbuf[0]), CharOf(kd.strbuf[1])));
}
@ -1314,15 +1315,15 @@ Input(XtermWidget xw,
{
/* VT220 & up: National Replacement Characters */
if ((xw->flags & NATIONAL) != 0) {
int cmp = xtermCharSetIn(CharOf(kd.strbuf[0]),
screen->keyboard_dialect[0]);
unsigned cmp = xtermCharSetIn(CharOf(kd.strbuf[0]),
screen->keyboard_dialect[0]);
TRACE(("...input NRC %d, %s %d\n",
CharOf(kd.strbuf[0]),
(CharOf(kd.strbuf[0]) == cmp)
? "unchanged"
: "changed to",
CharOf(cmp)));
kd.strbuf[0] = cmp;
kd.strbuf[0] = (char) cmp;
} else if (eightbit) {
prefix = ANSI_ESC;
} else if (kd.strbuf[0] == '?'
@ -1399,7 +1400,7 @@ decfuncvalue(KEY_DATA * kd)
/* after F20 the codes are made up and do not correspond to any
* real terminal. So they are simply numbered sequentially.
*/
result = 42 + (kd->keysym - XK_Fn(21));
result = 42 + (int) (kd->keysym - XK_Fn(21));
break;
}
} else {
@ -1479,7 +1480,7 @@ hpfuncvalue(ANSI * reply, KEY_DATA * kd)
}
if (result > 0) {
reply->a_type = ANSI_ESC;
reply->a_final = result;
reply->a_final = (Char) result;
}
#else
(void) reply;
@ -1569,7 +1570,7 @@ scofuncvalue(ANSI * reply, KEY_DATA * kd)
}
if (result > 0) {
reply->a_type = ANSI_CSI;
reply->a_final = result;
reply->a_final = (Char) result;
}
#else
(void) reply;
@ -1666,7 +1667,7 @@ sunfuncvalue(ANSI * reply, KEY_DATA * kd)
reply->a_final = 'z';
} else if (IsCursorKey(kd->keysym)) {
reply->a_type = ANSI_SS3;
reply->a_final = curfinal[kd->keysym - XK_Home];
reply->a_final = (Char) curfinal[kd->keysym - XK_Home];
}
#else
(void) reply;
@ -1678,7 +1679,7 @@ sunfuncvalue(ANSI * reply, KEY_DATA * kd)
#define isName(c) ((c) == '_' || isalnum(CharOf(c)))
/*
* Strip unneeded whitespace from a translations resource, lowercasing and
* Strip unneeded whitespace from a translations resource, mono-casing and
* returning a malloc'd copy of the result.
*/
static char *
@ -1700,7 +1701,7 @@ stripTranslations(const char *s)
ch = *s++;
if (ch == '\n') {
if (d != dst)
*d++ = ch;
*d++ = (char) ch;
state = 0;
} else if (strchr(":!#", ch) != 0) {
while (d != dst && isspace(CharOf(d[-1])))
@ -1714,7 +1715,7 @@ stripTranslations(const char *s)
while (d != dst && isspace(CharOf(d[-1])))
--d;
}
*d++ = char2lower(ch);
*d++ = x_toupper(ch);
++state;
}
prv = ch;

View File

@ -1,4 +1,4 @@
/* $XTermId: misc.c,v 1.384 2008/07/27 15:38:05 tom Exp $ */
/* $XTermId: misc.c,v 1.391 2008/12/30 17:44:50 tom Exp $ */
/*
*
@ -552,22 +552,27 @@ HandleStringEvent(Widget w GCC_UNUSED,
return;
if ((*params)[0] == '0' && (*params)[1] == 'x' && (*params)[2] != '\0') {
const char *abcdef = "ABCDEF";
const char *xxxxxx;
Char c, *p;
Char hexval[2];
hexval[0] = hexval[1] = 0;
for (p = (Char *) (*params + 2); (c = *p); p++) {
hexval[0] *= 16;
if (isupper(c))
c = tolower(c);
unsigned value = 0;
for (p = (Char *) (*params + 2); (c = CharOf(x_toupper(*p))) !=
'\0'; p++) {
value *= 16;
if (c >= '0' && c <= '9')
hexval[0] += c - '0';
else if (c >= 'a' && c <= 'f')
hexval[0] += c - 'a' + 10;
value += (unsigned) (c - '0');
else if ((xxxxxx = strchr(abcdef, c)) != 0)
value += (unsigned) (xxxxxx - abcdef) + 10;
else
break;
}
if (c == '\0')
if (c == '\0') {
Char hexval[2];
hexval[0] = (Char) value;
hexval[1] = 0;
StringInput(term, hexval, 1);
}
} else {
StringInput(term, (Char *) * params, strlen(*params));
}
@ -635,9 +640,9 @@ HandleSpawnTerminal(Widget w GCC_UNUSED,
|| setgid(screen->gid) == -1) {
fprintf(stderr, "Cannot reset uid/gid\n");
} else {
int myargc = *nparams + 1;
unsigned myargc = *nparams + 1;
char **myargv = TypeMallocN(char *, myargc + 1);
int n = 0;
unsigned n = 0;
myargv[n++] = child_exe;
@ -1676,10 +1681,10 @@ ReportAnsiColorRequest(XtermWidget xw, int colornum, int final)
unparse_end(xw);
}
static int
static unsigned
getColormapSize(Display * display)
{
int result;
unsigned result;
int numFound;
XVisualInfo myTemplate, *visInfoPtr;
@ -1687,7 +1692,7 @@ getColormapSize(Display * display)
XDefaultScreen(display)));
visInfoPtr = XGetVisualInfo(display, (long) VisualIDMask,
&myTemplate, &numFound);
result = (numFound >= 1) ? visInfoPtr->colormap_size : 0;
result = (numFound >= 1) ? (unsigned) visInfoPtr->colormap_size : 0;
XFree((char *) visInfoPtr);
return result;
@ -2330,8 +2335,10 @@ do_osc(XtermWidget xw, Char * oscbuf, unsigned len GCC_UNUSED, int final)
}
}
}
if (buf == 0)
if (buf == 0) {
TRACE(("do_osc found no data\n"));
return;
}
switch (mode) {
case 0: /* new icon name and title */
@ -2348,7 +2355,8 @@ do_osc(XtermWidget xw, Char * oscbuf, unsigned len GCC_UNUSED, int final)
break;
case 3: /* change X property */
ChangeXprop(buf);
if (screen->allowWindowOps)
ChangeXprop(buf);
break;
#if OPT_ISO_COLORS
case 4:
@ -2401,7 +2409,9 @@ do_osc(XtermWidget xw, Char * oscbuf, unsigned len GCC_UNUSED, int final)
case 50:
#if OPT_SHIFT_FONTS
if (buf != 0 && !strcmp(buf, "?")) {
if (!screen->allowFontOps && xw->misc.shift_fonts) {
; /* disabled via resource or control-sequence */
} else if (buf != 0 && !strcmp(buf, "?")) {
int num = screen->menu_font_number;
unparseputc1(xw, ANSI_OSC);
@ -2472,7 +2482,7 @@ do_osc(XtermWidget xw, Char * oscbuf, unsigned len GCC_UNUSED, int final)
#if OPT_PASTE64
case 52:
if (screen->allowWindowOps && (buf != 0))
if (screen->allowWindowOps)
ManipulateSelectionData(xw, screen, buf, final);
break;
#endif
@ -2546,12 +2556,12 @@ parse_decudk(char *cp)
int len = 0;
while (isdigit(CharOf(*cp)))
key = (key * 10) + (*cp++ - '0');
key = (key * 10) + (unsigned) (*cp++ - '0');
if (*cp == '/') {
cp++;
while ((hi = udk_value(&cp)) >= 0
&& (lo = udk_value(&cp)) >= 0) {
str[len++] = (hi << 4) | lo;
str[len++] = (char) ((hi << 4) | lo);
}
}
if (len > 0 && key < MAX_UDK) {
@ -2813,14 +2823,17 @@ do_dcs(XtermWidget xw, Char * dcsbuf, size_t dcslen)
} else
okay = False;
unparseputc1(xw, ANSI_DCS);
unparseputc(xw, okay ? '1' : '0');
unparseputc(xw, '$');
unparseputc(xw, 'r');
if (okay)
if (okay) {
unparseputc1(xw, ANSI_DCS);
unparseputc(xw, okay ? '1' : '0');
unparseputc(xw, '$');
unparseputc(xw, 'r');
cp = reply;
unparseputs(xw, cp);
unparseputc1(xw, ANSI_ST);
unparseputs(xw, cp);
unparseputc1(xw, ANSI_ST);
} else {
unparseputc(xw, ANSI_CAN);
}
} else {
unparseputc(xw, ANSI_CAN);
}
@ -2828,7 +2841,7 @@ do_dcs(XtermWidget xw, Char * dcsbuf, size_t dcslen)
#if OPT_TCAP_QUERY
case '+':
cp++;
if (*cp == 'q') {
if ((*cp == 'q') && screen->allowTcapOps) {
Bool fkey;
unsigned state;
int code;
@ -2892,16 +2905,18 @@ do_dcs(XtermWidget xw, Char * dcsbuf, size_t dcslen)
break;
#endif
default:
parse_ansi_params(&params, &cp);
switch (params.a_final) {
case '|': /* DECUDK */
if (params.a_param[0] == 0)
reset_decudk();
parse_decudk(cp);
break;
case '{': /* DECDLD (no '}' case though) */
parse_decdld(&params, cp);
break;
if (screen->terminal_id >= 200) { /* VT220 */
parse_ansi_params(&params, &cp);
switch (params.a_final) {
case '|': /* DECUDK */
if (params.a_param[0] == 0)
reset_decudk();
parse_decudk(cp);
break;
case '{': /* DECDLD (no '}' case though) */
parse_decdld(&params, cp);
break;
}
}
break;
}
@ -3351,7 +3366,7 @@ xtermFindShell(char *leaf, Bool warning)
}
#endif /* VMS */
#define ENV_HUNK(n) ((((n) + 1) | 31) + 1)
#define ENV_HUNK(n) (unsigned) ((((n) + 1) | 31) + 1)
/*
* copy the environment before Setenv'ing.

View File

@ -1,4 +1,4 @@
/* $XTermId: ptyx.h,v 1.518 2008/09/14 15:16:20 Paul.Lampert Exp $ */
/* $XTermId: ptyx.h,v 1.536 2008/12/30 17:22:55 tom Exp $ */
/*
* Copyright 1999-2007,2008 by Thomas E. Dickey
@ -339,13 +339,15 @@ typedef struct {
char *desc;
} OptionHelp;
typedef short ParmType;
typedef struct {
unsigned char a_type; /* CSI, etc., see unparseq() */
unsigned char a_pintro; /* private-mode char, if any */
unsigned char a_inters; /* special (before final-char) */
unsigned char a_final; /* final-char */
short a_nparam; /* # of parameters */
short a_param[NPARAM]; /* Parameters */
Char a_type; /* CSI, etc., see unparseq() */
Char a_pintro; /* private-mode char, if any */
Char a_inters; /* special (before final-char) */
Char a_final; /* final-char */
ParmType a_nparam; /* # of parameters */
ParmType a_param[NPARAM]; /* Parameters */
} ANSI;
#define TEK_FONT_LARGE 0
@ -1010,8 +1012,12 @@ extern int A2E(int);
/***====================================================================***/
#define LO_BYTE(ch) ((ch) & 0xff)
#define HI_BYTE(ch) ((ch) >> 8)
#define LO_BYTE(ch) CharOf((ch) & 0xff)
#define HI_BYTE(ch) CharOf((ch) >> 8)
#define PACK_FGBG(screen, row, col) \
(unsigned) ((SCRN_BUF_FGRND(screen, row)[col] << 8) \
| (SCRN_BUF_BGRND(screen, row)[col]))
#if OPT_WIDE_CHARS
#define if_OPT_WIDE_CHARS(screen, code) if(screen->wide_chars) code
@ -1200,8 +1206,9 @@ typedef enum {
DP_LAST
} SaveModes;
#define DoSM(code,value) screen->save_modes[code] = value
#define DoRM(code,value) value = screen->save_modes[code]
#define DoSM(code,value) screen->save_modes[code] = (unsigned) (value)
#define DoRM(code,value) value = (Boolean) screen->save_modes[code]
#define DoRM0(code,value) value = screen->save_modes[code]
/* index into vt_shell[] or tek_shell[] */
typedef enum {
@ -1235,9 +1242,9 @@ typedef struct {
int row;
int col;
unsigned flags; /* VTxxx saves graphics rendition */
char curgl;
char curgr;
char gsets[4];
Char curgl;
Char curgr;
Char gsets[4];
#if OPT_ISO_COLORS
int cur_foreground; /* current foreground color */
int cur_background; /* current background color */
@ -1366,8 +1373,8 @@ typedef struct {
#endif
int border; /* inner border */
int scrollBarBorder; /* scrollBar border */
unsigned long event_mask;
unsigned short send_mouse_pos; /* user wants mouse transition */
long event_mask;
unsigned send_mouse_pos; /* user wants mouse transition */
/* and position information */
Boolean send_focus_pos; /* user wants focus in/out info */
Boolean quiet_grab; /* true if no cursor change on focus */
@ -1378,8 +1385,8 @@ typedef struct {
* base64_flush() is the last step of the conversion, it clears these
* variables.
*/
int base64_accu;
int base64_count;
unsigned base64_accu;
unsigned base64_count;
unsigned base64_pad;
#endif
#if OPT_READLINE
@ -1394,7 +1401,7 @@ typedef struct {
Boolean locator_reset; /* turn mouse off after 1 report? */
Boolean locator_pixels; /* report in pixels? */
/* if false, report in cells */
unsigned short locator_events; /* what events to report */
unsigned locator_events; /* what events to report */
Boolean loc_filter; /* is filter rectangle active? */
int loc_filter_top; /* filter rectangle for DEC Locator */
int loc_filter_left;
@ -1408,12 +1415,19 @@ typedef struct {
Boolean bellOnReset; /* bellOnReset */
Boolean visualbell; /* visual bell mode */
Boolean poponbell; /* pop on bell mode */
Boolean allowFontOps; /* FontOps mode */
Boolean allowSendEvents;/* SendEvent mode */
Boolean allowTcapOps; /* TcapOps mode */
Boolean allowTitleOps; /* TitleOps mode */
Boolean allowWindowOps; /* WindowOps mode */
Boolean allowFontOp0; /* initial FontOps mode */
Boolean allowSendEvent0;/* initial SendEvent mode */
Boolean allowTcapOp0; /* initial TcapOps mode */
Boolean allowTitleOp0; /* initial TitleOps mode */
Boolean allowWindowOp0; /* initial WindowOps mode */
Boolean awaitInput; /* select-timeout mode */
Boolean grabbedKbd; /* keyboard is grabbed */
#ifdef ALLOWLOGGING
@ -1529,7 +1543,7 @@ typedef struct {
Boolean scrollkey; /* scroll to bottom on key */
Boolean cursor_moved; /* scrolling makes cursor move */
unsigned short do_wrap; /* true if cursor in last column
Boolean do_wrap; /* true if cursor in last column
and character just output */
int incopy; /* 0 idle; 1 XCopyArea issued;
@ -1552,11 +1566,11 @@ typedef struct {
int scrolls; /* outstanding scroll count,
used only with multiscroll */
SavedCursor sc[SAVED_CURSORS]; /* data for restore cursor */
unsigned char save_modes[DP_LAST]; /* save dec/xterm private modes */
unsigned save_modes[DP_LAST]; /* save dec/xterm private modes */
/* Improved VT100 emulation stuff. */
String keyboard_dialect; /* default keyboard dialect */
char gsets[4]; /* G0 through G3. */
Char gsets[4]; /* G0 through G3. */
Char curgl; /* Current GL setting. */
Char curgr; /* Current GR setting. */
Char curss; /* Current single shift. */
@ -1583,10 +1597,10 @@ typedef struct {
#if OPT_VT52_MODE
int vt52_save_level; /* save-area for DECANM */
char vt52_save_curgl;
char vt52_save_curgr;
char vt52_save_curss;
char vt52_save_gsets[4];
Char vt52_save_curgl;
Char vt52_save_curgr;
Char vt52_save_curss;
Char vt52_save_gsets[4];
#endif
/* Testing */
#if OPT_XMC_GLITCH
@ -1628,7 +1642,7 @@ typedef struct {
Boolean replyToEmacs; /* Send emacs escape code when done selecting or extending? */
Char *selection_data; /* the current selection */
int selection_size; /* size of allocated buffer */
int selection_length; /* number of significant bytes */
unsigned long selection_length; /* number of significant bytes */
EventMode eventMode;
Time selection_time; /* latest event timestamp */
Time lastButtonUpTime;

View File

@ -1,7 +1,7 @@
/* $XTermId: resize.c,v 1.106 2007/12/31 21:10:07 tom Exp $ */
/* $XTermId: resize.c,v 1.107 2008/12/30 17:07:56 tom Exp $ */
/*
* Copyright 2003-2006,2007 by Thomas E. Dickey
* Copyright 2003-2007,2008 by Thomas E. Dickey
*
* All Rights Reserved
*
@ -225,10 +225,10 @@ int
main(int argc, char **argv ENVP_ARG)
{
#ifdef USE_TERMCAP
register char *env;
char *env;
#endif
register char *ptr;
register int emu = VT100;
char *ptr;
int emu = VT100;
char *shell;
struct passwd *pw;
int i;
@ -500,7 +500,7 @@ main(int argc, char **argv ENVP_ARG)
}
static int
checkdigits(register char *str)
checkdigits(char *str)
{
while (*str) {
if (!isdigit(CharOf(*str)))
@ -511,9 +511,9 @@ checkdigits(register char *str)
}
static void
readstring(register FILE *fp, register char *buf, char *str)
readstring(FILE *fp, char *buf, char *str)
{
register int last, c;
int last, c;
#if !defined(USG) && !defined(__UNIXOS2__)
/* What is the advantage of setitimer() over alarm()? */
struct itimerval it;
@ -528,17 +528,20 @@ readstring(register FILE *fp, register char *buf, char *str)
setitimer(ITIMER_REAL, &it, (struct itimerval *) NULL);
#endif
if ((c = getc(fp)) == 0233) { /* meta-escape, CSI */
*buf++ = c = ESCAPE("")[0];
c = ESCAPE("")[0];
*buf++ = (char) c;
*buf++ = '[';
} else {
*buf++ = c;
*buf++ = (char) c;
}
if (c != *str) {
fprintf(stderr, "%s: unknown character, exiting.\r\n", myname);
onintr(0);
}
last = str[strlen(str) - 1];
while ((*buf++ = getc(fp)) != last) ;
while ((*buf++ = (char) getc(fp)) != last) {
;
}
#if defined(USG) || defined(__UNIXOS2__)
alarm(0);
#else

View File

@ -1,4 +1,4 @@
/* $XTermId: scrollbar.c,v 1.136 2008/06/03 20:55:33 tom Exp $ */
/* $XTermId: scrollbar.c,v 1.137 2008/12/30 15:40:13 tom Exp $ */
/* $XFree86: xc/programs/xterm/scrollbar.c,v 3.48 2006/02/13 01:14:59 dickey Exp $ */
@ -72,6 +72,7 @@
#include <error.h>
#include <menu.h>
#include <xcharmouse.h>
#include <xstrings.h>
/*
* The scrollbar's border overlaps the border of the vt100 window. If there
@ -593,11 +594,12 @@ ScrollTextUpDownBy(
}
/*
* assume that b is lower case and allow plural
* assume that b is alphabetic and allow plural
*/
static int
specialcmplowerwiths(char *a, char *b, int *modifier)
CompareWidths(char *a, char *b, int *modifier)
{
int result;
char ca, cb;
*modifier = 0;
@ -605,8 +607,8 @@ specialcmplowerwiths(char *a, char *b, int *modifier)
return 0;
while (1) {
ca = char2lower(*a);
cb = *b;
ca = x_toupper(*a);
cb = x_toupper(*b);
if (ca != cb || ca == '\0')
break; /* if not eq else both nul */
a++, b++;
@ -614,21 +616,25 @@ specialcmplowerwiths(char *a, char *b, int *modifier)
if (cb != '\0')
return 0;
if (ca == 's')
if (ca == 'S')
ca = *++a;
switch (ca) {
case '+':
case '-':
*modifier = (ca == '-' ? -1 : 1) * atoi(a + 1);
return 1;
result = 1;
break;
case '\0':
return 1;
result = 1;
break;
default:
return 0;
result = 0;
break;
}
return result;
}
static long
@ -641,11 +647,11 @@ params_to_pixels(TScreen * screen, String * params, Cardinal n)
switch (n > 2 ? 2 : n) {
case 2:
s = params[1];
if (specialcmplowerwiths(s, "page", &modifier)) {
if (CompareWidths(s, "PAGE", &modifier)) {
mult = (MaxRows(screen) + modifier) * FontHeight(screen);
} else if (specialcmplowerwiths(s, "halfpage", &modifier)) {
} else if (CompareWidths(s, "HALFPAGE", &modifier)) {
mult = ((MaxRows(screen) + modifier) * FontHeight(screen)) / 2;
} else if (specialcmplowerwiths(s, "pixel", &modifier)) {
} else if (CompareWidths(s, "PIXEL", &modifier)) {
mult = 1;
} else {
/* else assume that it is Line */

View File

@ -1,4 +1,4 @@
/* $XTermId: tabs.c,v 1.31 2008/02/24 17:35:03 Nemeth Exp $ */
/* $XTermId: tabs.c,v 1.33 2008/12/30 10:18:14 tom Exp $ */
/*
* $XFree86: xc/programs/xterm/tabs.c,v 3.14 2006/02/13 01:14:59 dickey Exp $
@ -116,7 +116,8 @@ TabNext(XtermWidget xw, Tabs tabs, int col)
if (screen->curses && screen->do_wrap && (xw->flags & WRAPAROUND)) {
xtermIndex(xw, 1);
set_cur_col(screen, 0);
col = screen->do_wrap = 0;
col = 0;
screen->do_wrap = False;
}
for (++col; col < MAX_TABS; ++col)
if (TST_TAB(tabs, col))
@ -134,7 +135,7 @@ static int
TabPrev(Tabs tabs, int col)
{
for (--col; col >= 0; --col)
if (TST_TAB(tabs, col))
if ((col < MAX_TABS) && TST_TAB(tabs, col))
return (col);
return (0);

View File

@ -1,4 +1,4 @@
/* $XTermId: util.c,v 1.407 2008/02/21 20:29:01 tom Exp $ */
/* $XTermId: util.c,v 1.410 2008/12/30 16:43:46 tom Exp $ */
/*
* Copyright 1999-2007,2008 by Thomas E. Dickey
@ -769,7 +769,7 @@ InsertLine(XtermWidget xw, int n)
ScrnDisownSelection(xw);
}
screen->do_wrap = 0;
screen->do_wrap = False;
if (n > (i = screen->bot_marg - screen->cur_row + 1))
n = i;
if (screen->jumpscroll) {
@ -841,7 +841,7 @@ DeleteLine(XtermWidget xw, int n)
ScrnDisownSelection(xw);
}
screen->do_wrap = 0;
screen->do_wrap = False;
if (n > (i = screen->bot_marg - screen->cur_row + 1))
n = i;
if (screen->jumpscroll) {
@ -930,7 +930,7 @@ InsertChar(XtermWidget xw, unsigned n)
&& ScrnIsLineInSelection(screen, row)) {
ScrnDisownSelection(xw);
}
screen->do_wrap = 0;
screen->do_wrap = False;
assert(screen->cur_col <= screen->max_col);
limit = MaxCols(screen) - screen->cur_col;
@ -1006,7 +1006,7 @@ DeleteChar(XtermWidget xw, unsigned n)
&& ScrnIsLineInSelection(screen, row)) {
ScrnDisownSelection(xw);
}
screen->do_wrap = 0;
screen->do_wrap = False;
assert(screen->cur_col <= screen->max_col);
limit = MaxCols(screen) - screen->cur_col;
@ -1193,7 +1193,7 @@ ClearInLine2(XtermWidget xw, int flags, int row, int col, unsigned len)
if (screen->cursor_state)
HideCursor();
screen->do_wrap = 0;
screen->do_wrap = False;
if (AddToVisible(xw)) {
ClearCurBackground(xw,
@ -1274,6 +1274,7 @@ ClearRight(XtermWidget xw, int n)
/* with the right part cleared, we can't be wrapping */
ScrnClrWrapped(screen, screen->cur_row);
screen->do_wrap = False;
}
/*
@ -1324,7 +1325,7 @@ ClearScreen(XtermWidget xw)
HideCursor();
ScrnDisownSelection(xw);
screen->do_wrap = 0;
screen->do_wrap = False;
if ((top = INX2ROW(screen, 0)) <= screen->max_row) {
if (screen->scroll_amt)
FlushScroll(xw);
@ -3598,19 +3599,6 @@ my_strerror(int n)
#endif
#endif
int
char2lower(int ch)
{
if (isascii(ch) && isupper(ch)) { /* lowercasify */
#ifdef _tolower
ch = _tolower(ch);
#else
ch = tolower(ch);
#endif
}
return ch;
}
void
update_keyboard_type(void)
{

View File

@ -1,4 +1,4 @@
/* $XTermId: version.h,v 1.293 2008/09/14 13:45:26 tom Exp $ */
/* $XTermId: version.h,v 1.294 2008/10/05 16:46:50 tom Exp $ */
/*
* These definitions are used to build the string that's printed in response to
@ -6,7 +6,7 @@
* version of X to which this version of xterm has been built. The number in
* parentheses is my patch number (Thomas E. Dickey).
*/
#define XTERM_PATCH 237
#define XTERM_PATCH 238
#ifndef __vendorversion__
#define __vendorversion__ "XTerm/OpenBSD"

View File

@ -1,5 +1,5 @@
#!/usr/bin/perl -w
# $XTermId: tcapquery.pl,v 1.12 2007/12/16 14:02:35 tom Exp $
# $XTermId: tcapquery.pl,v 1.13 2008/10/05 16:20:14 tom Exp $
#
# -- Thomas Dickey (2004/3/3)
# Test the tcap-query option of xterm.
@ -227,12 +227,15 @@ query_tcap( "Fr", "kf63");
if ( defined($opt_a) || defined($opt_k) ) {
query_tcap( "K1", "ka1");
query_tcap( "K3", "ka3");
query_tcap( "K4", "kc1");
query_tcap( "K5", "kc3");
}
if ( defined($opt_a) || defined($opt_m) ) {
query_tcap( "kB", "kcbt");
query_tcap( "kC", "kclr");
query_tcap( "&8", "kund");
query_tcap( "kb", "kbs");

View File

@ -1,4 +1,4 @@
/* $XTermId: xcharmouse.h,v 1.10 2007/02/07 23:32:03 tom Exp $ */
/* $XTermId: xcharmouse.h,v 1.11 2008/10/05 21:18:49 tom Exp $ */
/************************************************************
@ -65,7 +65,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#endif /* OPT_DEC_LOCATOR */
/* Values for screen->send_mouse_pos */
enum {
typedef enum {
MOUSE_OFF
,X10_MOUSE
,VT200_MOUSE
@ -73,6 +73,6 @@ enum {
,BTN_EVENT_MOUSE
,ANY_EVENT_MOUSE
,DEC_LOCATOR
};
} XtermMouseModes;
#endif /* included_xcharmouse_h */

View File

@ -1,10 +1,10 @@
/* $XTermId: xstrings.c,v 1.26 2007/06/09 13:43:00 tom Exp $ */
/* $XTermId: xstrings.c,v 1.28 2008/12/30 17:10:37 tom Exp $ */
/* $XFree86: xc/programs/xterm/xstrings.c,v 1.10 2006/02/13 01:14:59 dickey Exp $ */
/************************************************************
Copyright 2000-2006,2007 by Thomas E. Dickey
Copyright 2000-2007,2008 by Thomas E. Dickey
All Rights Reserved
@ -111,8 +111,8 @@ int
x_strncasecmp(const char *s1, const char *s2, unsigned n)
{
while (n-- != 0) {
int c1 = toupper(CharOf(*s1));
int c2 = toupper(CharOf(*s2));
char c1 = x_toupper(*s1);
char c2 = x_toupper(*s2);
if (c1 != c2)
return 1;
if (c1 == 0)
@ -186,3 +186,29 @@ x_strtrim(char *s)
}
return base;
}
/*
* Avoid using system locale for upper/lowercase conversion, since there are
* a few locales where toupper(tolower(c)) != c.
*/
char
x_toupper(int ch)
{
static char table[256];
char result = table[CharOf(ch)];
if (result == '\0') {
unsigned n;
const char *s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (n = 0; n < sizeof(table); ++n) {
table[n] = (char) n;
}
for (n = 0; s[n] != '\0'; ++n) {
table[CharOf(s[n])] = s[n % 26];
}
result = table[CharOf(ch)];
}
return result;
}

View File

@ -1,10 +1,10 @@
/* $XTermId: xstrings.h,v 1.12 2007/06/09 13:35:28 tom Exp $ */
/* $XTermId: xstrings.h,v 1.14 2008/12/30 17:10:43 tom Exp $ */
/* $XFree86: xc/programs/xterm/xstrings.h,v 1.5 2006/02/13 01:14:59 dickey Exp $ */
/************************************************************
Copyright 2000-2006,2007 by Thomas E. Dickey
Copyright 2000-2007,2008 by Thomas E. Dickey
All Rights Reserved
@ -45,6 +45,7 @@ extern char *x_skip_nonblanks(char * /* s */);
extern char *x_strdup(const char * /* s */);
extern char *x_strindex(char * /* s1 */, char * /* s2 */);
extern char *x_strtrim(char * /* s */);
extern char x_toupper(int /* ch */);
extern int x_strcasecmp(const char * /* s1 */, const char * /* s2 */);
extern int x_strncasecmp(const char * /* s1 */, const char * /* s2 */, unsigned /* n */);

View File

@ -1,4 +1,4 @@
/* $XTermId: xterm.h,v 1.503 2008/09/14 15:18:39 Paul.Lampert Exp $ */
/* $XTermId: xterm.h,v 1.507 2008/12/30 15:46:41 tom Exp $ */
/************************************************************
@ -337,7 +337,9 @@ extern char **environ;
/***====================================================================***/
#define XtNallowC1Printable "allowC1Printable"
#define XtNallowFontOps "allowFontOps"
#define XtNallowSendEvents "allowSendEvents"
#define XtNallowTcapOps "allowTcapOps"
#define XtNallowTitleOps "allowTitleOps"
#define XtNallowWindowOps "allowWindowOps"
#define XtNaltIsNotMeta "altIsNotMeta"
@ -492,7 +494,9 @@ extern char **environ;
#define XtNxmcMoveSGR "xmcMoveSGR"
#define XtCAllowC1Printable "AllowC1Printable"
#define XtCAllowFontOps "AllowFontOps"
#define XtCAllowSendEvents "AllowSendEvents"
#define XtCAllowTcapOps "AllowTcapOps"
#define XtCAllowTitleOps "AllowTitleOps"
#define XtCAllowWindowOps "AllowWindowOps"
#define XtCAltIsNotMeta "AltIsNotMeta"
@ -1105,7 +1109,6 @@ extern GC updatedXtermGC (XtermWidget /* xw */, unsigned /* flags */, unsigned
extern int AddToRefresh (XtermWidget /* xw */);
extern int ClearInLine (XtermWidget /* xw */, int /* row */, int /* col */, unsigned /* len */);
extern int HandleExposure (XtermWidget /* xw */, XEvent * /* event */);
extern int char2lower (int /* ch */);
extern int drawXtermText (XtermWidget /* xw */, unsigned /* flags */, GC /* gc */, int /* x */, int /* y */, int /* chrset */, PAIRED_CHARS(Char * /* text */, Char * /* text2 */), Cardinal /* len */, int /* on_wide */);
extern void ChangeColors (XtermWidget /* xw */, ScrnColors * /* pNew */);
extern void ClearRight (XtermWidget /* xw */, int /* n */);
@ -1229,15 +1232,15 @@ extern void putXtermCell (TScreen * /* screen */, int /* row */, int /* col */
#if OPT_HIGHLIGHT_COLOR
#define isNotForeground(xw, fg, bg, sel) \
((sel) != T_COLOR(&((xw)->screen), TEXT_FG) \
&& (sel) != (fg) \
&& (sel) != (bg) \
&& (sel) != (xw)->dft_foreground)
(Boolean) ((sel) != T_COLOR(&((xw)->screen), TEXT_FG) \
&& (sel) != (fg) \
&& (sel) != (bg) \
&& (sel) != (xw)->dft_foreground)
#define isNotBackground(xw, fg, bg, sel) \
((sel) != T_COLOR(&((xw)->screen), TEXT_BG) \
&& (sel) != (fg) \
&& (sel) != (bg) \
&& (sel) != (xw)->dft_background)
(Boolean) ((sel) != T_COLOR(&((xw)->screen), TEXT_BG) \
&& (sel) != (fg) \
&& (sel) != (bg) \
&& (sel) != (xw)->dft_background)
#endif
#if OPT_WIDE_CHARS

View File

@ -20,7 +20,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF *
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
*****************************************************************************
$XTermId: xterm.log.html,v 1.690 2008/09/14 23:43:15 tom Exp $
$XTermId: xterm.log.html,v 1.703 2008/12/30 19:09:49 tom Exp $
-->
<HTML>
<HEAD>
@ -45,6 +45,7 @@ Most of these are summarized in the XFree86 CHANGELOG
is the latest version of this file.
<UL>
<LI><A HREF="#xterm_238">Patch #238 - 2008/12/30</A>
<LI><A HREF="#xterm_237">Patch #237 - 2008/09/14</A>
<LI><A HREF="#xterm_236">Patch #236 - 2008/07/27</A>
<LI><A HREF="#xterm_235">Patch #235 - 2008/04/20</A>
@ -285,6 +286,53 @@ is the latest version of this file.
<LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
</UL>
<H1><A NAME="xterm_238">Patch #238 - 2008/12/30</A></H1>
<ul>
<li>update configure macro CF_XOPEN_SOURCE for AIX 6.x and Mint
platforms.
<li>reset the screen wrapping-flag at the end of
<code>ClearRight</code> to fix an occasional case where the last
character of a scrolled and wrapped line would be cleared (patch by
Joe Peterson).
<li>modify to use POSIX coding for comparing resource settings such
as <code>locale</code>, to work with locales such as Turkish
(report by M Vefa Bicakci).
<li>turn on configure <code>paste64</code> feature by default
(request by Jean-Philippe Bernardy).
It is runtime enabled/disabled with <code>allowWindowOps</code>.
<li>turn on configure <code>tcap-query</code> feature by default,
add resource <code>allowTcapOps</code>
to make this runtime enabled/disabled.
<li>make <code>OSC 3</code> (change X property, from
<a href="#xterm_110">patch #110</a>)
subject to <code>allowWindowOps</code> resource.
<li>make VT220 <code>DSR</code> responses inactive in VT100-mode.
<li>make <code>DECUDK</code> feature inactive in VT100-mode.
<li>respond to incorrectly formatted <code>DECRQSS</code> with a
cancel.
<li>add <code>allowFontOps</code>
resource to allow the fontsize-switching and font query/set
control sequences to be enabled/disabled
(prompted by Debian #510030).
<li>some code cleanup based on gcc 4.x <code>-Wconversion</code>
warnings in button.c and charproc.c
<li>modify <code>tcap-query</code> feature to not return data for
shifted cursor-keys when the keyboard type is set to vt220,
since returning the same string for shifted/unshifted keys may
confuse some applications (GenToo #212546).
</ul>
<H1><A NAME="xterm_237">Patch #237 - 2008/09/14</A></H1>
<ul>
<li>improve usability of TrueType fonts by making the font-size

View File

@ -1,5 +1,5 @@
'\" t
.\" $XTermId: xterm.man,v 1.411 2008/09/14 23:06:19 tom Exp $
.\" $XTermId: xterm.man,v 1.413 2008/12/30 11:23:59 tom Exp $
.\"
.\" Copyright 1996-2007,2008 by Thomas E. Dickey
.\"
@ -1445,6 +1445,10 @@ as if they were printable characters.
Although this corresponds to no particular standard,
some users insist it is a VT100.
The default is ``false.''
.TP
.B "allowFontOps (\fPclass\fB AllowFontOps)"
Specifies whether control sequences that set/query the font should be allowed.
The default is ``true.''
.TP 8
.B "allowSendEvents (\fPclass\fB AllowSendEvents)"
Specifies whether or not synthetic key and button events (generated using
@ -1454,6 +1458,12 @@ Note that allowing
such events creates a very large security hole.
The default is ``false.''
.TP
.B "allowTcapOps (\fPclass\fB AllowTcapOps)"
Specifies whether control sequences that query the terminal's
notion of its function-key strings, as termcap or terminfo capabilities
should be allowed.
The default is ``true.''
.TP
.B "allowTitleOps (\fPclass\fB AllowTitleOps)"
Specifies whether control sequences that modify the window title or icon name
should be allowed.
@ -5090,6 +5100,9 @@ Thomas Dickey (invisible-island.net).
.SH OPENBSD SPECIFICS
On OpenBSD, the following resources have different default values:
.TP 8
.B allowWindowOps: false
Extended window control sequences are disabled.
.TP 8
.B deleteIsDEL: true
The Delete key generates \fB^?\fP.
.TP 8

View File

@ -1,7 +1,7 @@
/* $XTermId: xtermcap.c,v 1.13 2008/07/27 15:18:56 tom Exp $ */
/* $XTermId: xtermcap.c,v 1.14 2008/10/05 16:43:36 tom Exp $ */
/*
* Copyright 2007 by Thomas E. Dickey
* Copyright 2007,2008 by Thomas E. Dickey
*
* All Rights Reserved
*
@ -156,6 +156,8 @@ static TCAPINFO table[] = {
DATA( "K1", "ka1", XK_KP_Home, 0 ),
DATA( "K4", "kc1", XK_KP_End, 0 ),
DATA( "K3", "ka3", XK_KP_Prior, 0 ),
DATA( "K5", "kc3", XK_KP_Next, 0 ),
#ifdef XK_ISO_Left_Tab
DATA( "kB", "kcbt", XK_ISO_Left_Tab, 0 ),
@ -165,6 +167,7 @@ static TCAPINFO table[] = {
DATA( "kI", "kich1", XK_Insert, 0 ),
DATA( "kN", "knp", XK_Next, 0 ),
DATA( "kP", "kpp", XK_Prior, 0 ),
DATA( "&8", "kund", XK_Undo, 0 ),
DATA( "kb", "kbs", XK_BackSpace, 0 ),
# if OPT_TCAP_QUERY && OPT_ISO_COLORS
/* XK_COLORS is a fake code. */
@ -213,7 +216,7 @@ hex2int(int c)
}
static TCAPINFO *
lookupTcapByName(const char *name)
lookupTcapByName(XtermWidget xw, const char *name)
{
TCAPINFO *result = 0;
Cardinal n;
@ -226,6 +229,24 @@ lookupTcapByName(const char *name)
}
}
}
/*
* The vt220-keyboard will not return distinct key sequences for shifted
* cursor-keys. Just pretend they do not exist, since some programs may
* be confused if we return the same data for shifted/unshifted keys.
*/
if (xw->keyboard.type == keyboardIsVT220
&& result != 0
&& result->state == 2) {
result = 0;
}
if (result != 0) {
TRACE(("lookupTcapByName(%s) tc=%s, ti=%s code %#x, state %#x\n",
name, result->tc, result->ti, result->code, result->state));
} else {
TRACE(("lookupTcapByName(%s) FAIL\n", name));
}
return result;
}
@ -263,7 +284,7 @@ xtermcapKeycode(XtermWidget xw, char **params, unsigned *state, Bool * fkey)
*fkey = False;
if (*p == 0 || *p == ';') {
if ((data = lookupTcapByName(name)) != 0) {
if ((data = lookupTcapByName(xw, name)) != 0) {
code = data->code;
*state = xtermParamToState(xw, data->state);
if (IsFunctionKey(code)) {