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 * Copyright 1999-2008,2009 by Thomas E. Dickey
@ -2590,12 +2590,10 @@ SetCharacterClassRange(int low, /* in range of [0..255] */
} }
#endif #endif
#if OPT_WIDE_CHARS
static int static int
class_of(TScreen * screen, LineData * ld, CELL * cell) class_of(LineData * ld, CELL * cell)
{ {
CELL temp = *cell; CELL temp = *cell;
int value;
#if OPT_DEC_CHRSET #if OPT_DEC_CHRSET
if (CSET_DOUBLE(GetLineDblCS(ld))) { if (CSET_DOUBLE(GetLineDblCS(ld))) {
@ -2603,19 +2601,19 @@ class_of(TScreen * screen, LineData * ld, CELL * cell)
} }
#endif #endif
value = (int) XTERM_CELL(temp.row, temp.col); return CharacterClass((int) (ld->charData[temp.col]));
return CharacterClass(value);
} }
#if OPT_WIDE_CHARS
#define CClassSelects(name, cclass) \ #define CClassSelects(name, cclass) \
(CClassOf(name) == cclass \ (CClassOf(name) == cclass \
|| XTERM_CELL(screen->name.row, screen->name.col) == HIDDEN_CHAR) || XTERM_CELL(screen->name.row, screen->name.col) == HIDDEN_CHAR)
#else #else
#define class_of(screen, ld, cell) charClass[XTERM_CELL((cell)->row, (cell)->col)]
#define CClassSelects(name, cclass) \ #define CClassSelects(name, cclass) \
(class_of(screen, ld.name, &((screen->name))) == cclass) (class_of(ld.name, &((screen->name))) == cclass)
#endif #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 * 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) { while (col <= limit) {
Char *next = last; Char *next = last;
unsigned data = XTERM_CELL(row, col); unsigned data = ld->charData[col];
/* some internal points may not be drawn */ /* some internal points may not be drawn */
if (data == 0) if (data == 0)
@ -2745,7 +2743,7 @@ make_indexed_text(TScreen * screen, int row, unsigned length, int *indexed)
if_OPT_WIDE_CHARS(screen, { if_OPT_WIDE_CHARS(screen, {
size_t off; size_t off;
for_each_combData(off, ld) { for_each_combData(off, ld) {
data = XTERM_CELLC(row, col, off); data = ld->combData[off][col];
if (data == 0) if (data == 0)
break; break;
next = convertToUTF8(next, data); next = convertToUTF8(next, data);
@ -3847,7 +3845,7 @@ SaveText(TScreen * screen,
#endif #endif
*eol = !LineTstWrapped(ld); *eol = !LineTstWrapped(ld);
for (i = scol; i < ecol; i++) { for (i = scol; i < ecol; i++) {
c = E2A(XTERM_CELL(row, i)); c = E2A(ld->charData[i]);
#if OPT_WIDE_CHARS #if OPT_WIDE_CHARS
/* We want to strip out every occurrence of HIDDEN_CHAR AFTER a /* We want to strip out every occurrence of HIDDEN_CHAR AFTER a
* wide character. * wide character.
@ -3861,7 +3859,7 @@ SaveText(TScreen * screen,
unsigned ch; unsigned ch;
size_t off; size_t off;
for_each_combData(off, ld) { for_each_combData(off, ld) {
ch = XTERM_CELLC(row, i, off); ch = ld->combData[off][i];
if (ch == 0) if (ch == 0)
break; break;
lp = convertToUTF8(lp, ch); lp = convertToUTF8(lp, ch);
@ -3877,7 +3875,7 @@ SaveText(TScreen * screen,
unsigned ch; unsigned ch;
size_t off; size_t off;
for_each_combData(off, ld) { for_each_combData(off, ld) {
ch = XTERM_CELLC(row, i, off); ch = ld->combData[off][i];
if (ch == 0) if (ch == 0)
break; break;
lp = convertToUTF8(lp, ch); 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) { for (pass = 0; pass < 2; ++pass) {
row = screen->cur_row; row = screen->cur_row;
for (; isClear && (row <= screen->max_row); ++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; col = (row == screen->cur_row) ? screen->cur_col : 0;
for (; isClear && (col <= screen->max_col); ++col) { for (; isClear && (col <= screen->max_col); ++col) {
@ -861,7 +862,7 @@ CheckBogusForeground(TScreen * screen, const char *tag)
} else if ((flags & BG_COLOR)) { } else if ((flags & BG_COLOR)) {
isClear = False; isClear = False;
} else if ((flags & FG_COLOR)) { } else if ((flags & FG_COLOR)) {
unsigned ch = getXtermCell(screen, row, col); unsigned ch = ld->charData[col];
isClear = ((ch == ' ') || (ch == 0)); isClear = ((ch == ' ') || (ch == 0));
} else { } else {
isClear = False; 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 #if OPT_WIDE_CHARS
#define CharKnownMissing(font, ch) \ #define CharKnownMissing(font, ch) \
((ch) < 256 && (font)->known_missing[(Char)(ch)]) (((ch) < 256) && ((font)->known_missing[(Char)(ch)] > 1))
#else #else
#define CharKnownMissing(font, ch) \ #define CharKnownMissing(font, ch) \
((font)->known_missing[(Char)(ch)]) ((font)->known_missing[(Char)(ch)] > 1)
#endif #endif
#define IsXtermMissingChar(screen, ch, font) \ #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++) { for (col = 0; col < last; col++) {
ch = ld->charData[col]; ch = ld->charData[col];
if_OPT_WIDE_CHARS(screen, {
ch = XTERM_CELL(row, col);
});
#if OPT_PRINT_COLORS #if OPT_PRINT_COLORS
if (screen->colorMode) { if (screen->colorMode) {
if (screen->print_attributes > 1) { if (screen->print_attributes > 1) {
@ -221,7 +218,7 @@ printLine(XtermWidget xw, int row, unsigned chr)
if_OPT_WIDE_CHARS(screen, { if_OPT_WIDE_CHARS(screen, {
size_t off; size_t off;
for_each_combData(off, ld) { for_each_combData(off, ld) {
ch = XTERM_CELLC(row, col, off); ch = ld->combData[off][col];
if (ch == 0) if (ch == 0)
break; break;
charToPrinter(xw, ch); 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 * Copyright 1999-2008,2009 by Thomas E. Dickey
@ -1212,7 +1212,7 @@ typedef struct {
#define INX2ABS(screen, inx) ROW2ABS(screen, INX2ROW(screen, inx)) #define INX2ABS(screen, inx) ROW2ABS(screen, INX2ROW(screen, inx))
#define okScrnRow(screen, row) \ #define okScrnRow(screen, row) \
((row) <= (screen)->max_row \ ((row) <= ((screen)->max_row - (screen)->topline) \
&& (row) >= -((screen)->savedlines)) && (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. /* Find the preceding cell.
*/ */
ld = getLineData(screen, row); ld = getLineData(screen, row);
if (XTERM_CELL(row, col) != XMC_GLITCH) { if (ld->charData[col] != XMC_GLITCH) {
if (col != 0) { if (col != 0) {
col--; col--;
} else if (!screen->xmc_inline && row != 0) { } else if (!screen->xmc_inline && row != 0) {
@ -206,7 +206,7 @@ Resolve_XMC(XtermWidget xw)
ld = getLineData(screen, ++row); ld = getLineData(screen, ++row);
} else } else
break; break;
if (XTERM_CELL(row, col) == XMC_GLITCH) if (ld->charData[col] == XMC_GLITCH)
break; break;
if ((ld->attribs[col] & my_attrs) != start) { if ((ld->attribs[col] & my_attrs) != start) {
ld->attribs[col] = 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 * Copyright 1999-2008,2009 by Thomas E. Dickey
@ -103,21 +103,22 @@ int (*my_wcwidth) (wchar_t);
int int
DamagedCells(TScreen * screen, unsigned n, int *klp, int *krp, int row, int col) DamagedCells(TScreen * screen, unsigned n, int *klp, int *krp, int row, int col)
{ {
LineData *ld = getLineData(screen, row);
int kl = col; int kl = col;
int kr = col + (int) n; int kr = col + (int) n;
if (XTERM_CELL(row, kl) == HIDDEN_CHAR) { if (ld->charData[kl] == HIDDEN_CHAR) {
while (kl > 0) { while (kl > 0) {
if (XTERM_CELL(row, --kl) != HIDDEN_CHAR) { if (ld->charData[--kl] != HIDDEN_CHAR) {
break; break;
} }
} }
} else { } else {
kl = col + 1; kl = col + 1;
} }
if (XTERM_CELL(row, kr) == HIDDEN_CHAR) { if (ld->charData[kr] == HIDDEN_CHAR) {
while (kr < screen->max_col) { while (kr < screen->max_col) {
if (XTERM_CELL(row, ++kr) != HIDDEN_CHAR) { if (ld->charData[++kr] != HIDDEN_CHAR) {
--kr; --kr;
break; break;
} }
@ -3010,11 +3011,20 @@ drawXtermText(XtermWidget xw,
(unsigned) (last - first), on_wide); (unsigned) (last - first), on_wide);
} }
#if OPT_WIDE_CHARS #if OPT_WIDE_CHARS
if (!ucs_workaround(xw, ch, flags, gc, if (ucs_workaround(xw, ch, flags, gc,
x, y, x, y,
chrset, on_wide)) 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 #endif
{ {
if (ch_width <= 0)
ch_width = 1;
xtermDrawBoxChar(xw, ch, flags, gc, xtermDrawBoxChar(xw, ch, flags, gc,
x, y, x, y,
ch_width); ch_width);
@ -3544,14 +3554,6 @@ putXtermCell(TScreen * screen, int row, int col, int ch)
} }
#if OPT_WIDE_CHARS #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 * 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 * version of X to which this version of xterm has been built. The number in
* parentheses is my patch number (Thomas E. Dickey). * parentheses is my patch number (Thomas E. Dickey).
*/ */
#define XTERM_PATCH 247 #define XTERM_PATCH 248
#ifndef __vendorversion__ #ifndef __vendorversion__
#define __vendorversion__ "XTerm/OpenBSD" #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 */ #endif /* OPT_ISO_COLORS */
#define XTERM_CELL(row,col) getXtermCell(screen, ROW2INX(screen, row), col) #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 unsigned getXtermCell (TScreen * /* screen */, int /* row */, int /* col */);
extern void putXtermCell (TScreen * /* screen */, int /* row */, int /* col */, int /* ch */); 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 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 int DamagedCurCells(TScreen * /* screen */, unsigned /* n */, int * /* klp */, int * /* krp */);
extern unsigned AsciiEquivs(unsigned /* ch */); 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 addXtermCombining (TScreen * /* screen */, int /* row */, int /* col */, unsigned /* ch */);
extern void allocXtermChars(ScrnPtr * /* buffer */, Cardinal /* length */); extern void allocXtermChars(ScrnPtr * /* buffer */, Cardinal /* length */);
#endif #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 * * 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 * * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF *
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * 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> <HTML>
<HEAD> <HEAD>
@ -45,6 +45,7 @@ Most of these are summarized in the XFree86 CHANGELOG
is the latest version of this file. is the latest version of this file.
<UL> <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_247">Patch #247 - 2009/8/30</A>
<LI><A HREF="#xterm_246">Patch #246 - 2009/8/16</A> <LI><A HREF="#xterm_246">Patch #246 - 2009/8/16</A>
<LI><A HREF="#xterm_245">Patch #245 - 2009/8/12</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> <LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
</UL> </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> <H1><A NAME="xterm_247">Patch #247 - 2009/8/30</A></H1>
<ul> <ul>
<li>add ifdef's and check for openpty() on DragonFly (patch by <li>add ifdef's and check for openpty() on DragonFly (patch by