summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2009-09-19 00:03:37 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2009-09-19 00:03:37 +0000
commited8b3b16aefdd3a68f7633703ff8db5152b47a7d (patch)
tree9d23f12ce4c87a8433c3cad2cfe8a08028076ca0
parentcc709574dee9e1fab08578d16d3e008705a4f215 (diff)
Update to xterm 248, fixing several bugs including a regression with
copy-and-paste. Works for martynas@, ok matthieu@
-rw-r--r--app/xterm/button.c26
-rw-r--r--app/xterm/charproc.c7
-rw-r--r--app/xterm/fontutils.h6
-rw-r--r--app/xterm/print.c7
-rw-r--r--app/xterm/ptyx.h4
-rw-r--r--app/xterm/testxmc.c6
-rw-r--r--app/xterm/util.c34
-rw-r--r--app/xterm/version.h2
-rw-r--r--app/xterm/xterm.h4
-rw-r--r--app/xterm/xterm.log.html22
10 files changed, 66 insertions, 52 deletions
diff --git a/app/xterm/button.c b/app/xterm/button.c
index 526a90247..41019b063 100644
--- a/app/xterm/button.c
+++ b/app/xterm/button.c
@@ -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);
diff --git a/app/xterm/charproc.c b/app/xterm/charproc.c
index 9a93cff4d..79b973f9b 100644
--- a/app/xterm/charproc.c
+++ b/app/xterm/charproc.c
@@ -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;
diff --git a/app/xterm/fontutils.h b/app/xterm/fontutils.h
index 33c385f96..2022707a3 100644
--- a/app/xterm/fontutils.h
+++ b/app/xterm/fontutils.h
@@ -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) \
diff --git a/app/xterm/print.c b/app/xterm/print.c
index 7200e3eb6..3310ba065 100644
--- a/app/xterm/print.c
+++ b/app/xterm/print.c
@@ -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);
diff --git a/app/xterm/ptyx.h b/app/xterm/ptyx.h
index 04da907e1..54b000a07 100644
--- a/app/xterm/ptyx.h
+++ b/app/xterm/ptyx.h
@@ -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))
/*
diff --git a/app/xterm/testxmc.c b/app/xterm/testxmc.c
index c275bb82f..e179749a9 100644
--- a/app/xterm/testxmc.c
+++ b/app/xterm/testxmc.c
@@ -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] =
diff --git a/app/xterm/util.c b/app/xterm/util.c
index 7f590539e..4a740b6b5 100644
--- a/app/xterm/util.c
+++ b/app/xterm/util.c
@@ -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
*/
diff --git a/app/xterm/version.h b/app/xterm/version.h
index 1d683175f..92721d2b4 100644
--- a/app/xterm/version.h
+++ b/app/xterm/version.h
@@ -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"
diff --git a/app/xterm/xterm.h b/app/xterm/xterm.h
index 25d308429..001c18974 100644
--- a/app/xterm/xterm.h
+++ b/app/xterm/xterm.h
@@ -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
diff --git a/app/xterm/xterm.log.html b/app/xterm/xterm.log.html
index f0b680c95..1cc906ec3 100644
--- a/app/xterm/xterm.log.html
+++ b/app/xterm/xterm.log.html
@@ -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