Update to xterm 248, fixing several bugs including a regression with

copy-and-paste. Works for martynas@, ok matthieu@
This commit is contained in:
sthen 2009-09-19 00:03:36 +00:00
parent 6bf1497d91
commit 6b50184426
10 changed files with 66 additions and 52 deletions

View File

@ -1,4 +1,4 @@
/* $XTermId: button.c,v 1.349 2009/08/07 23:24:10 tom Exp $ */
/* $XTermId: button.c,v 1.352 2009/09/11 09:13:53 tom Exp $ */
/*
* Copyright 1999-2008,2009 by Thomas E. Dickey
@ -2590,12 +2590,10 @@ SetCharacterClassRange(int low, /* in range of [0..255] */
}
#endif
#if OPT_WIDE_CHARS
static int
class_of(TScreen * screen, LineData * ld, CELL * cell)
class_of(LineData * ld, CELL * cell)
{
CELL temp = *cell;
int value;
#if OPT_DEC_CHRSET
if (CSET_DOUBLE(GetLineDblCS(ld))) {
@ -2603,19 +2601,19 @@ class_of(TScreen * screen, LineData * ld, CELL * cell)
}
#endif
value = (int) XTERM_CELL(temp.row, temp.col);
return CharacterClass(value);
return CharacterClass((int) (ld->charData[temp.col]));
}
#if OPT_WIDE_CHARS
#define CClassSelects(name, cclass) \
(CClassOf(name) == cclass \
|| XTERM_CELL(screen->name.row, screen->name.col) == HIDDEN_CHAR)
#else
#define class_of(screen, ld, cell) charClass[XTERM_CELL((cell)->row, (cell)->col)]
#define CClassSelects(name, cclass) \
(class_of(screen, ld.name, &((screen->name))) == cclass)
(class_of(ld.name, &((screen->name))) == cclass)
#endif
#define CClassOf(name) class_of(screen, ld.name, &((screen->name)))
#define CClassOf(name) class_of(ld.name, &((screen->name)))
/*
* If the given column is past the end of text on the given row, bump to the
@ -2729,7 +2727,7 @@ make_indexed_text(TScreen * screen, int row, unsigned length, int *indexed)
while (col <= limit) {
Char *next = last;
unsigned data = XTERM_CELL(row, col);
unsigned data = ld->charData[col];
/* some internal points may not be drawn */
if (data == 0)
@ -2745,7 +2743,7 @@ make_indexed_text(TScreen * screen, int row, unsigned length, int *indexed)
if_OPT_WIDE_CHARS(screen, {
size_t off;
for_each_combData(off, ld) {
data = XTERM_CELLC(row, col, off);
data = ld->combData[off][col];
if (data == 0)
break;
next = convertToUTF8(next, data);
@ -3847,7 +3845,7 @@ SaveText(TScreen * screen,
#endif
*eol = !LineTstWrapped(ld);
for (i = scol; i < ecol; i++) {
c = E2A(XTERM_CELL(row, i));
c = E2A(ld->charData[i]);
#if OPT_WIDE_CHARS
/* We want to strip out every occurrence of HIDDEN_CHAR AFTER a
* wide character.
@ -3861,7 +3859,7 @@ SaveText(TScreen * screen,
unsigned ch;
size_t off;
for_each_combData(off, ld) {
ch = XTERM_CELLC(row, i, off);
ch = ld->combData[off][i];
if (ch == 0)
break;
lp = convertToUTF8(lp, ch);
@ -3877,7 +3875,7 @@ SaveText(TScreen * screen,
unsigned ch;
size_t off;
for_each_combData(off, ld) {
ch = XTERM_CELLC(row, i, off);
ch = ld->combData[off][i];
if (ch == 0)
break;
lp = convertToUTF8(lp, ch);

View File

@ -1,4 +1,4 @@
/* $XTermId: charproc.c,v 1.971 2009/08/09 13:59:06 tom Exp $ */
/* $XTermId: charproc.c,v 1.972 2009/09/10 09:03:49 tom Exp $ */
/*
@ -850,7 +850,8 @@ CheckBogusForeground(TScreen * screen, const char *tag)
for (pass = 0; pass < 2; ++pass) {
row = screen->cur_row;
for (; isClear && (row <= screen->max_row); ++row) {
Char *attribs = getLineData(screen, row)->attribs;
LineData *ld = getLineData(screen, row)->;
Char *attribs = ld->attribs;
col = (row == screen->cur_row) ? screen->cur_col : 0;
for (; isClear && (col <= screen->max_col); ++col) {
@ -861,7 +862,7 @@ CheckBogusForeground(TScreen * screen, const char *tag)
} else if ((flags & BG_COLOR)) {
isClear = False;
} else if ((flags & FG_COLOR)) {
unsigned ch = getXtermCell(screen, row, col);
unsigned ch = ld->charData[col];
isClear = ((ch == ' ') || (ch == 0));
} else {
isClear = False;

View File

@ -1,4 +1,4 @@
/* $XTermId: fontutils.h,v 1.75 2009/08/07 22:46:12 tom Exp $ */
/* $XTermId: fontutils.h,v 1.76 2009/09/09 23:31:55 tom Exp $ */
/************************************************************
@ -71,10 +71,10 @@ extern char *xtermSpecialFont (TScreen */* screen */, unsigned /* atts */, unsig
#if OPT_WIDE_CHARS
#define CharKnownMissing(font, ch) \
((ch) < 256 && (font)->known_missing[(Char)(ch)])
(((ch) < 256) && ((font)->known_missing[(Char)(ch)] > 1))
#else
#define CharKnownMissing(font, ch) \
((font)->known_missing[(Char)(ch)])
((font)->known_missing[(Char)(ch)] > 1)
#endif
#define IsXtermMissingChar(screen, ch, font) \

View File

@ -1,4 +1,4 @@
/* $XTermId: print.c,v 1.107 2009/08/31 00:37:04 tom Exp $ */
/* $XTermId: print.c,v 1.109 2009/09/10 09:06:30 tom Exp $ */
/************************************************************
@ -162,9 +162,6 @@ printLine(XtermWidget xw, int row, unsigned chr)
}
for (col = 0; col < last; col++) {
ch = ld->charData[col];
if_OPT_WIDE_CHARS(screen, {
ch = XTERM_CELL(row, col);
});
#if OPT_PRINT_COLORS
if (screen->colorMode) {
if (screen->print_attributes > 1) {
@ -221,7 +218,7 @@ printLine(XtermWidget xw, int row, unsigned chr)
if_OPT_WIDE_CHARS(screen, {
size_t off;
for_each_combData(off, ld) {
ch = XTERM_CELLC(row, col, off);
ch = ld->combData[off][col];
if (ch == 0)
break;
charToPrinter(xw, ch);

View File

@ -1,4 +1,4 @@
/* $XTermId: ptyx.h,v 1.626 2009/08/30 21:40:45 Alex.Hornung Exp $ */
/* $XTermId: ptyx.h,v 1.627 2009/09/10 08:50:02 tom Exp $ */
/*
* Copyright 1999-2008,2009 by Thomas E. Dickey
@ -1212,7 +1212,7 @@ typedef struct {
#define INX2ABS(screen, inx) ROW2ABS(screen, INX2ROW(screen, inx))
#define okScrnRow(screen, row) \
((row) <= (screen)->max_row \
((row) <= ((screen)->max_row - (screen)->topline) \
&& (row) >= -((screen)->savedlines))
/*

View File

@ -1,4 +1,4 @@
/* $XTermId: testxmc.c,v 1.44 2009/06/21 15:37:04 tom Exp $ */
/* $XTermId: testxmc.c,v 1.45 2009/09/10 09:05:20 tom Exp $ */
/************************************************************
@ -185,7 +185,7 @@ Resolve_XMC(XtermWidget xw)
/* Find the preceding cell.
*/
ld = getLineData(screen, row);
if (XTERM_CELL(row, col) != XMC_GLITCH) {
if (ld->charData[col] != XMC_GLITCH) {
if (col != 0) {
col--;
} else if (!screen->xmc_inline && row != 0) {
@ -206,7 +206,7 @@ Resolve_XMC(XtermWidget xw)
ld = getLineData(screen, ++row);
} else
break;
if (XTERM_CELL(row, col) == XMC_GLITCH)
if (ld->charData[col] == XMC_GLITCH)
break;
if ((ld->attribs[col] & my_attrs) != start) {
ld->attribs[col] =

View File

@ -1,4 +1,4 @@
/* $XTermId: util.c,v 1.486 2009/08/15 00:40:38 tom Exp $ */
/* $XTermId: util.c,v 1.489 2009/09/10 09:22:43 tom Exp $ */
/*
* Copyright 1999-2008,2009 by Thomas E. Dickey
@ -103,21 +103,22 @@ int (*my_wcwidth) (wchar_t);
int
DamagedCells(TScreen * screen, unsigned n, int *klp, int *krp, int row, int col)
{
LineData *ld = getLineData(screen, row);
int kl = col;
int kr = col + (int) n;
if (XTERM_CELL(row, kl) == HIDDEN_CHAR) {
if (ld->charData[kl] == HIDDEN_CHAR) {
while (kl > 0) {
if (XTERM_CELL(row, --kl) != HIDDEN_CHAR) {
if (ld->charData[--kl] != HIDDEN_CHAR) {
break;
}
}
} else {
kl = col + 1;
}
if (XTERM_CELL(row, kr) == HIDDEN_CHAR) {
if (ld->charData[kr] == HIDDEN_CHAR) {
while (kr < screen->max_col) {
if (XTERM_CELL(row, ++kr) != HIDDEN_CHAR) {
if (ld->charData[++kr] != HIDDEN_CHAR) {
--kr;
break;
}
@ -3010,11 +3011,20 @@ drawXtermText(XtermWidget xw,
(unsigned) (last - first), on_wide);
}
#if OPT_WIDE_CHARS
if (!ucs_workaround(xw, ch, flags, gc,
x, y,
chrset, on_wide))
if (ucs_workaround(xw, ch, flags, gc,
x, y,
chrset, on_wide)) {
/*
* if true, we drew at least one cell whether or not it is
* printable
*/
if (ch_width <= 0)
ch_width = 1;
} else
#endif
{
if (ch_width <= 0)
ch_width = 1;
xtermDrawBoxChar(xw, ch, flags, gc,
x, y,
ch_width);
@ -3544,14 +3554,6 @@ putXtermCell(TScreen * screen, int row, int col, int ch)
}
#if OPT_WIDE_CHARS
unsigned
getXtermCellComb(TScreen * screen, int row, int col, unsigned off)
{
LineData *ld = getLineData(screen, row);
return (unsigned) ld->combData[off][col];
}
/*
* Add a combining character for the given cell
*/

View File

@ -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 247
#define XTERM_PATCH 248
#ifndef __vendorversion__
#define __vendorversion__ "XTerm/OpenBSD"

View File

@ -1,4 +1,4 @@
/* $XTermId: xterm.h,v 1.581 2009/08/08 14:04:16 tom Exp $ */
/* $XTermId: xterm.h,v 1.582 2009/09/10 09:01:22 tom Exp $ */
/************************************************************
@ -1249,7 +1249,6 @@ extern Pixel xtermGetColorRes(ColorRes *res);
#endif /* OPT_ISO_COLORS */
#define XTERM_CELL(row,col) getXtermCell(screen, ROW2INX(screen, row), col)
#define XTERM_CELLC(row,col,n) getXtermCellComb(screen, ROW2INX(screen, row), col, n)
extern unsigned getXtermCell (TScreen * /* screen */, int /* row */, int /* col */);
extern void putXtermCell (TScreen * /* screen */, int /* row */, int /* col */, int /* ch */);
@ -1272,7 +1271,6 @@ extern Boolean isWideControl(unsigned /* ch */);
extern int DamagedCells(TScreen * /* screen */, unsigned /* n */, int * /* klp */, int * /* krp */, int /* row */, int /* col */);
extern int DamagedCurCells(TScreen * /* screen */, unsigned /* n */, int * /* klp */, int * /* krp */);
extern unsigned AsciiEquivs(unsigned /* ch */);
extern unsigned getXtermCellComb (TScreen * /* screen */, int /* row */, int /* col */, unsigned /* off */);
extern void addXtermCombining (TScreen * /* screen */, int /* row */, int /* col */, unsigned /* ch */);
extern void allocXtermChars(ScrnPtr * /* buffer */, Cardinal /* length */);
#endif

View File

@ -1,4 +1,4 @@
t<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
*****************************************************************************
* Copyright 1996-2008,2009 by Thomas E. Dickey *
@ -20,7 +20,7 @@ t<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
* 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.785 2009/08/30 23:59:11 tom Exp $
$XTermId: xterm.log.html,v 1.790 2009/09/11 23:10:00 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_248">Patch #248 - 2009/9/11</A>
<LI><A HREF="#xterm_247">Patch #247 - 2009/8/30</A>
<LI><A HREF="#xterm_246">Patch #246 - 2009/8/16</A>
<LI><A HREF="#xterm_245">Patch #245 - 2009/8/12</A>
@ -295,6 +296,23 @@ is the latest version of this file.
<LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
</UL>
<H1><A NAME="xterm_248">Patch #248 - 2009/9/11</A></H1>
<ul>
<li>fix an overlooked adjustment for selecting double-width characters
in the narrow-character configuration.
<li>eliminate uses of <code>XTERM_CELL</code> and
<code>XTERM_CELLC</code> where an appropriate <code>LineData</code>
pointer is available.
<li>correct expression in <code>okScrnRow</code> macro, making
selections give the length of lines below the visible screen
(report by Stuart Henderson).
<li>correct logic used to improve performance of missing-glyph check,
which did not handle line-drawing characters (Debian #545220).
</ul>
<H1><A NAME="xterm_247">Patch #247 - 2009/8/30</A></H1>
<ul>
<li>add ifdef's and check for openpty() on DragonFly (patch by