Skip to content
Permalink
Browse files Browse the repository at this point in the history
snapshot of project "xterm", label xterm-365d
  • Loading branch information
ThomasDickey committed Feb 10, 2021
1 parent a0763eb commit 82ba55b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion MANIFEST
@@ -1,4 +1,4 @@
MANIFEST for xterm, version xterm-365c
MANIFEST for xterm, version xterm-365d
--------------------------------------------------------------------------------
MANIFEST this file
256colres.h resource-definitions for 256-color mode
Expand Down
25 changes: 20 additions & 5 deletions button.c
@@ -1,4 +1,4 @@
/* $XTermId: button.c,v 1.631 2021/02/04 01:00:26 tom Exp $ */
/* $XTermId: button.c,v 1.634 2021/02/09 23:04:41 tom Exp $ */

/*
* Copyright 1999-2020,2021 by Thomas E. Dickey
Expand Down Expand Up @@ -4323,6 +4323,7 @@ SaltTextAway(XtermWidget xw,
int i;
int eol;
int need = 0;
size_t have = 0;
Char *line;
Char *lp;
CELL first = *cellc;
Expand Down Expand Up @@ -4357,7 +4358,11 @@ SaltTextAway(XtermWidget xw,

/* UTF-8 may require more space */
if_OPT_WIDE_CHARS(screen, {
need *= 4;
if (need > 0) {
if (screen->max_combining > 0)
need += screen->max_combining;
need *= 6;
}
});

/* now get some memory to save it in */
Expand Down Expand Up @@ -4395,10 +4400,20 @@ SaltTextAway(XtermWidget xw,
}
*lp = '\0'; /* make sure we have end marked */

TRACE(("Salted TEXT:%u:%s\n", (unsigned) (lp - line),
visibleChars(line, (unsigned) (lp - line))));
have = (size_t) (lp - line);
/*
* Scanning the buffer twice is unnecessary. Discard unwanted memory if
* the estimate is too-far off.
*/
if ((have * 2) < (size_t) need) {
scp->data_limit = have + 1;
line = realloc(line, scp->data_limit);
}

TRACE(("Salted TEXT:%u:%s\n", (unsigned) have,
visibleChars(line, (unsigned) have)));

scp->data_length = (size_t) (lp - line);
scp->data_length = have;
}

#if OPT_PASTE64
Expand Down
5 changes: 4 additions & 1 deletion xterm.log.html
Expand Up @@ -30,7 +30,7 @@
* sale, use or other dealings in this Software without prior written *
* authorization. *
*****************************************************************************
$XTermId: xterm.log.html,v 1.2309 2021/02/09 01:30:44 tom Exp $
$XTermId: xterm.log.html,v 1.2311 2021/02/09 21:59:33 tom Exp $
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
Expand Down Expand Up @@ -1013,6 +1013,9 @@ <h1>Contents</h1>
<h1><a name="xterm_dev" id="xterm_dev">Development</a></h1>

<ul>
<li>correct upper-limit for selection buffer, accounting for
combining characters (report by Tavis Ormandy).</li>

<li>with <code>alwaysHighlight</code> true, xterm does not
properly track focus. The <em>screen-&gt;select</em>
<code>FOCUS</code> flag remains always on, which prevents
Expand Down

0 comments on commit 82ba55b

Please sign in to comment.