INSTALL | 11 MANIFEST | 2 Makefile.in | 9 Tekproc.c | 42 aclocal.m4 | 38 button.c | 113 - cachedGCs.c | 25 charproc.c | 94 config.guess | 15 config.sub | 16 configure | 3862 +++++++++++++++++------------------ configure.in | 7 cursor.c | 32 data.c | 6 data.h | 8 debian/changelog | 9 debian/patches/900_debian_xterm.diff | 11 debian/patches/902_windowops.diff | 2 debian/patches/904_fontops.diff | 2 doublechr.c | 13 fontutils.c | 49 graphics.c | 29 graphics.h | 42 graphics_regis.c | 146 - graphics_regis.h | 8 graphics_sixel.c | 187 - graphics_sixel.h | 8 input.c | 31 keysym2ucs.c | 6 main.c | 23 menu.c | 6 misc.c | 152 - package/debian/changelog | 6 package/freebsd/Makefile | 2 package/xterm.spec | 4 precompose.c | 8 print.c | 26 ptydata.c | 7 ptyx.h | 8 scrollback.c | 9 scrollbar.c | 17 svg.c | 8 termcap | 14 terminfo | 9 trace.c | 49 trace.h | 12 unicode/README | 13 unicode/convmap.pl | 9 unicode/keysym.map | 3 unicode/precompose.c.tail | 6 util.c | 214 + version.c | 9 version.h | 6 wcwidth.c | 22 xstrings.c | 24 xterm.h | 3 xterm.log.html | 103 xterm.man | 94 xtermcap.c | 24 xtermcfg.hin | 19 60 files changed, 3046 insertions(+), 2686 deletions(-)
New commits: commit 7839c581096745ef3762ededccacae9dfe21521f Author: Sven Joachim <svenj...@gmx.de> Date: Mon Jun 6 17:58:39 2016 +0200 Close bug #738794 diff --git a/debian/changelog b/debian/changelog index 3822bbc..945d330 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ xterm (325-1) UNRELEASED; urgency=medium * New upstream release. + - Further improve fix for #545220 in xterm 248, to avoid conflict + with combining characters (Closes: #738794). * Refresh Debian patches. -- Sven Joachim <svenj...@gmx.de> Mon, 06 Jun 2016 17:28:47 +0200 commit 42909c82b37e7ac1b9e4c5efa54a92f9128bb2e6 Author: Sven Joachim <svenj...@gmx.de> Date: Mon Jun 6 17:46:45 2016 +0200 Refresh Debian patches The patch 900_debian_xterm.diff failed to apply. diff --git a/debian/changelog b/debian/changelog index b64c3f4..3822bbc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ xterm (325-1) UNRELEASED; urgency=medium * New upstream release. + * Refresh Debian patches. -- Sven Joachim <svenj...@gmx.de> Mon, 06 Jun 2016 17:28:47 +0200 diff --git a/debian/patches/900_debian_xterm.diff b/debian/patches/900_debian_xterm.diff index afa1da4..5023b46 100644 --- a/debian/patches/900_debian_xterm.diff +++ b/debian/patches/900_debian_xterm.diff @@ -24,8 +24,8 @@ This patch by Branden Robinson. XTerm-col.ad | 42 +++++++++++++++++++++++++++--------------- XTerm.ad | 3 +++ termcap | 4 +++- - terminfo | 8 ++++++-- - 4 files changed, 39 insertions(+), 18 deletions(-) + terminfo | 6 ++++-- + 4 files changed, 37 insertions(+), 18 deletions(-) --- a/termcap +++ b/termcap @@ -49,7 +49,7 @@ This patch by Branden Robinson. # # Encode modifiers using parameters (see "Xterm Control Sequences" ctlseqs.ms). # Note that this is unrelated to PCTERM. -@@ -1970,11 +1972,13 @@ xterm-r5|xterm R5 version, +@@ -1972,12 +1974,12 @@ xterm-r5|xterm R5 version, # This is the only entry which you should have to customize, since "xterm" # is widely used for a variety of incompatible terminal emulations including # color_xterm and rxvt. @@ -60,14 +60,13 @@ This patch by Branden Robinson. # This fragment is for people who cannot agree on what the backspace key # should send. -+# Modified to more strictly conform to the DEC VT220 behavior; this is -+# mandated by Section 9.8 of the Debian Policy Manual. xterm+kbs|fragment for backspace key, - kbs=^H, + kbs=\177, + # kbs=^?, --- a/XTerm.ad +++ b/XTerm.ad -@@ -161,6 +161,9 @@ +@@ -163,6 +163,9 @@ *tek4014*font3: 6x13 *tek4014*fontSmall: 6x10 diff --git a/debian/patches/902_windowops.diff b/debian/patches/902_windowops.diff index f2cfe3e..5b484ba 100644 --- a/debian/patches/902_windowops.diff +++ b/debian/patches/902_windowops.diff @@ -4,7 +4,7 @@ --- a/xterm.man +++ b/xterm.man -@@ -2648,8 +2648,9 @@ This is a comma-separated list of names, +@@ -2675,8 +2675,9 @@ This is a comma-separated list of names, from \fIdtterm\fP the operation number). The default value is .RS diff --git a/debian/patches/904_fontops.diff b/debian/patches/904_fontops.diff index fbf732b..389705b 100644 --- a/debian/patches/904_fontops.diff +++ b/debian/patches/904_fontops.diff @@ -4,7 +4,7 @@ --- a/xterm.man +++ b/xterm.man -@@ -1899,7 +1899,7 @@ The default is \*(``true\*(''. +@@ -1926,7 +1926,7 @@ The default is \*(``true\*(''. .TP .B "allowFontOps (\fPclass\fB AllowFontOps)" Specifies whether control sequences that set/query the font should be allowed. commit 2569b5c8a3338312f9f7154f801a0ead66066a43 Author: Sven Joachim <svenj...@gmx.de> Date: Mon Jun 6 17:28:50 2016 +0200 New upstream release diff --git a/debian/changelog b/debian/changelog index 982405a..b64c3f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xterm (325-1) UNRELEASED; urgency=medium + + * New upstream release. + + -- Sven Joachim <svenj...@gmx.de> Mon, 06 Jun 2016 17:28:47 +0200 + xterm (324-2) unstable; urgency=medium * Enable all hardening options. commit c9cb401305a4c9866c5462a724410472c4e6db29 Author: Sven Joachim <svenj...@gmx.de> Date: Mon Jun 6 17:27:21 2016 +0200 Imported Upstream version 325 diff --git a/INSTALL b/INSTALL index f049a7c..e2f03b4 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,6 @@ --- $XTermId: INSTALL,v 1.158 2015/08/10 23:38:32 tom Exp $ +-- $XTermId: INSTALL,v 1.159 2016/05/28 18:39:26 tom Exp $ ------------------------------------------------------------------------------- --- Copyright 1997-2014,2015 by Thomas E. Dickey +-- Copyright 1997-2015,2016 by Thomas E. Dickey -- -- All Rights Reserved -- @@ -777,6 +777,13 @@ The options (in alphabetic order): Activate the --disable-leaks option, and ensure that "-g" is added to CFLAGS. + --without-xinerama do not use Xinerama extension for multiple screens + + Xinerama is an X server extension that allows multiple physical + screens to behave as a single screen. If you do not need the feature + (or do not want the extra library dependency), use this option to + suppress it. + --with-xpm=DIR use Xpm library for colored icon, may specify path Use Xpm library to show colored icon in window decoration, e.g., diff --git a/MANIFEST b/MANIFEST index 818655f..98e5f3b 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,4 +1,4 @@ -MANIFEST for xterm-324, version xterm-324 +MANIFEST for xterm-325, version xterm-325 -------------------------------------------------------------------------------- MANIFEST this file 256colres.h resource-definitions for 256-color mode diff --git a/Makefile.in b/Makefile.in index 5064a12..17b273d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,8 +1,8 @@ -## $XTermId: Makefile.in,v 1.234 2015/02/12 09:31:30 tom Exp $ +## $XTermId: Makefile.in,v 1.235 2016/05/15 16:45:53 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # -# Copyright 1997-2014,2015 by Thomas E. Dickey +# Copyright 1997-2015,2016 by Thomas E. Dickey # # All Rights Reserved # @@ -52,6 +52,7 @@ ETAGS = @ETAGS@ LN_S = @LN_S@ RM = rm -f LINT = @LINT@ +LINT_OPTS = @LINT_OPTS@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -563,8 +564,8 @@ koi8rxterm.ps : koi8rxterm.$(manext) koi8rxterm.txt : koi8rxterm.$(manext) ################################################################################ lint : - $(LINT) $(CPPFLAGS) $(SRCS1) - $(LINT) $(CPPFLAGS) $(SRCS2) + $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(SRCS1) + $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(SRCS2) tags : $(CTAGS) $(SRCS) $(HDRS) diff --git a/Tekproc.c b/Tekproc.c index 6f8da47..a640643 100644 --- a/Tekproc.c +++ b/Tekproc.c @@ -1,7 +1,7 @@ -/* $XTermId: Tekproc.c,v 1.198 2014/07/12 22:55:02 tom Exp $ */ +/* $XTermId: Tekproc.c,v 1.199 2016/05/16 09:14:46 tom Exp $ */ /* - * Copyright 2001-2012,2014 by Thomas E. Dickey + * Copyright 2001-2014,2016 by Thomas E. Dickey * * All Rights Reserved * @@ -416,12 +416,11 @@ Tekparse(TekWidget tw) TScreen *screen = TScreenOf(xw); TekScreen *tekscr = TekScreenOf(tw); int x, y; - IChar c = 0; IChar ch; int nextstate; for (;;) { - c = input(); + IChar c = input(); /* * The parsing tables all have 256 entries. If we're supporting * wide characters, we handle them by treating them the same as @@ -1036,12 +1035,15 @@ TekPage(TekWidget tw) static int getpoint(TekWidget tw) { - int c, x, y, e, lo_y = 0; + int x, y, e, lo_y = 0; TekScreen *tekscr = TekScreenOf(tw); x = tekscr->cur.x; y = tekscr->cur.y; + for (;;) { + int c; + if ((c = (int) input()) < ' ') { /* control character */ unput(c); return (0); @@ -1083,16 +1085,12 @@ TCursorBack(TekWidget tw) { TekScreen *tekscr = TekScreenOf(tw); const struct Tek_Char *t; - int x, l; - - x = (tekscr->cur_X -= - (t = &TekChar[tekscr->cur.fontsize])->hsize - ); + int x = (tekscr->cur_X -= (t = &TekChar[tekscr->cur.fontsize])->hsize); if (((tekscr->margin == MARGIN1) && (x < 0)) || ((tekscr->margin == MARGIN2) && (x < TEKWIDTH / 2))) { - if ((l = (tekscr->cur_Y + (t->vsize - 1)) / t->vsize + 1) >= - t->nlines) { + int l = ((tekscr->cur_Y + (t->vsize - 1)) / t->vsize + 1); + if (l >= t->nlines) { tekscr->margin = !tekscr->margin; l = 0; } @@ -1105,14 +1103,11 @@ static void TCursorForward(TekWidget tw) { TekScreen *tekscr = TekScreenOf(tw); - const struct Tek_Char *t; - int l; + const struct Tek_Char *t = &TekChar[tekscr->cur.fontsize]; - if ((tekscr->cur_X += - (t = &TekChar[tekscr->cur.fontsize])->hsize - ) > TEKWIDTH - ) { - if ((l = tekscr->cur_Y / t->vsize - 1) < 0) { + if ((tekscr->cur_X += t->hsize) > TEKWIDTH) { + int l = (tekscr->cur_Y / t->vsize - 1); + if (l < 0) { tekscr->margin = !tekscr->margin; l = t->nlines - 1; } @@ -1733,7 +1728,6 @@ void ChangeTekColors(TekWidget tw, TScreen *screen, ScrnColors * pNew) { TekScreen *tekscr = TekScreenOf(tw); - int i; XGCValues gcv; if (COLOR_DEFINED(pNew, TEK_FG)) { @@ -1753,6 +1747,8 @@ ChangeTekColors(TekWidget tw, TScreen *screen, ScrnColors * pNew) } if (tw) { + int i; + XSetForeground(XtDisplay(tw), tekscr->TnormalGC, T_COLOR(screen, TEK_FG)); XSetBackground(XtDisplay(tw), tekscr->TnormalGC, @@ -1785,7 +1781,6 @@ TekReverseVideo(TekWidget tw) XtermWidget xw = term; TScreen *screen = TScreenOf(xw); TekScreen *tekscr = TekScreenOf(tw); - int i; Pixel tmp; XGCValues gcv; @@ -1794,6 +1789,8 @@ TekReverseVideo(TekWidget tw) T_COLOR(screen, TEK_CURSOR) = T_COLOR(screen, TEK_FG); if (tw) { + int i; + XSetForeground(XtDisplay(tw), tekscr->TnormalGC, T_COLOR(screen, TEK_FG)); XSetBackground(XtDisplay(tw), tekscr->TnormalGC, T_COLOR(screen, TEK_BG)); @@ -1903,7 +1900,6 @@ TekCopy(TekWidget tw) TekLink *Tp; char buf[TIMESTAMP_LEN + 10]; - char initbuf[5]; int tekcopyfd; timestamp_filename(buf, "COPY"); @@ -1921,6 +1917,8 @@ TekCopy(TekWidget tw) tekcopyfd = open_userfile(screen->uid, screen->gid, buf, False); if (tekcopyfd >= 0) { + char initbuf[5]; + sprintf(initbuf, "%c%c%c%c", ANSI_ESC, (char) (tekscr->page.fontsize + '8'), ANSI_ESC, (char) (tekscr->page.linetype + '`')); diff --git a/aclocal.m4 b/aclocal.m4 index 9ac69df..1aa0c3e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -dnl $XTermId: aclocal.m4,v 1.408 2016/03/11 00:54:28 tom Exp $ +dnl $XTermId: aclocal.m4,v 1.412 2016/05/28 18:42:52 tom Exp $ dnl dnl --------------------------------------------------------------------------- dnl @@ -254,11 +254,15 @@ ifelse([$3],,[ :]dnl ])dnl ])])dnl dnl --------------------------------------------------------------------------- -dnl CF_CC_ENV_FLAGS version: 2 updated: 2015/04/12 15:39:00 +dnl CF_CC_ENV_FLAGS version: 3 updated: 2016/05/21 18:10:17 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content dnl into CC. This will not help with broken scripts that wrap the compiler with dnl options, but eliminates a more common category of user confusion. +dnl +dnl Caveat: this also disallows blanks in the pathname for the compiler, but +dnl the nuisance of having inconsistent settings for compiler and preprocessor +dnl outweighs that limitation. AC_DEFUN([CF_CC_ENV_FLAGS], [ # This should have been defined by AC_PROG_CC @@ -266,13 +270,16 @@ AC_DEFUN([CF_CC_ENV_FLAGS], AC_MSG_CHECKING(\$CC variable) case "$CC" in -(*[[\ \ ]]-[[IUD]]*) +(*[[\ \ ]]-*) AC_MSG_RESULT(broken) AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) # humor him... - cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'` + cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]][[ ]]*//'` CC=`echo "$CC" | sed -e 's/[[ ]].*//'` CF_ADD_CFLAGS($cf_flags) + CF_VERBOSE(resulting CC: '$CC') + CF_VERBOSE(resulting CFLAGS: '$CFLAGS') + CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS') ;; (*) AC_MSG_RESULT(ok) @@ -1893,6 +1900,14 @@ AC_SUBST(GROFF_NOTE) AC_SUBST(NROFF_NOTE) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_PROG_LINT version: 3 updated: 2016/05/22 15:25:54 +dnl ------------ +AC_DEFUN([CF_PROG_LINT], +[ +AC_CHECK_PROGS(LINT, lint cppcheck splint) +AC_SUBST(LINT_OPTS) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_REGEX version: 12 updated: 2015/04/18 08:56:57 dnl -------- dnl Attempt to determine if we've got one of the flavors of regular-expression @@ -3769,6 +3784,21 @@ CF_NO_LEAKS_OPTION(valgrind, [USE_VALGRIND]) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_WITH_XINERAMA version: 1 updated: 2016/05/28 14:41:12 +dnl ---------------- +AC_DEFUN([CF_WITH_XINERAMA], +[ +AC_MSG_CHECKING(if you want to use the Xinerama extension) +AC_ARG_WITH(xinerama, +[ --without-xinerama do not use Xinerama extension for multiscreen support], + [cf_with_xinerama="$withval"], + [cf_with_xinerama=yes]) +AC_MSG_RESULT($cf_with_xinerama) +if test "$cf_with_xinerama" = yes; then + CF_XINERAMA +fi +])dnl +dnl --------------------------------------------------------------------------- dnl CF_WITH_XPM version: 3 updated: 2012/10/04 06:57:36 dnl ----------- dnl Test for Xpm library, update compiler/loader flags if it is wanted and diff --git a/button.c b/button.c index 630e212..1532d3d 100644 --- a/button.c +++ b/button.c @@ -1,4 +1,4 @@ -/* $XTermId: button.c,v 1.501 2016/03/06 19:16:35 tom Exp $ */ +/* $XTermId: button.c,v 1.505 2016/05/30 19:42:44 tom Exp $ */ /* * Copyright 1999-2015,2016 by Thomas E. Dickey @@ -562,7 +562,6 @@ InitLocatorFilter(XtermWidget xw) int row = 0, col = 0; Bool oor = 0; Bool ret; - int state; ret = XQueryPointer(screen->display, VWindow(screen), &root, &child, &rx, &ry, &x, &y, &mask); @@ -643,6 +642,8 @@ InitLocatorFilter(XtermWidget xw) (col > screen->loc_filter_right) || (row < screen->loc_filter_top) || (row > screen->loc_filter_bottom)) { + int state; + /* Pointer is already outside the rectangle - report immediately */ ButtonState(state, mask); @@ -679,7 +680,6 @@ CheckLocatorPosition(XtermWidget xw, XButtonEvent *event) TScreen *screen = TScreenOf(xw); int row, col; Bool oor; - int state; LocatorCoords(row, col, event->x, event->y, oor); @@ -703,6 +703,8 @@ CheckLocatorPosition(XtermWidget xw, XButtonEvent *event) reply.a_nparam = 1; reply.a_param[0] = 0; /* Event - 0 = locator unavailable */ } else { + int state; + ButtonState(state, event->state); reply.a_nparam = 4; @@ -838,10 +840,12 @@ rowOnCurrentLine(TScreen *screen, int *deltap) /* must be XButtonEvent */ { int result = 1; - int l1, l2; *deltap = 0; + if (line != screen->cur_row) { + int l1, l2; + if (line < screen->cur_row) l1 = line, l2 = screen->cur_row; else @@ -947,12 +951,13 @@ DiredButton(Widget w, if ((xw = getXtermWidget(w)) != 0) { TScreen *screen = TScreenOf(xw); - Char Line[6]; - unsigned line, col; if (IsBtnEvent(event) && (event->xbutton.y >= screen->border) && (event->xbutton.x >= OriginX(screen))) { + Char Line[6]; + unsigned line, col; + line = (unsigned) ((event->xbutton.y - screen->border) / FontHeight(screen)); col = (unsigned) ((event->xbutton.x - OriginX(screen)) @@ -1036,14 +1041,16 @@ ViButton(Widget w, if ((xw = getXtermWidget(w)) != 0) { TScreen *screen = TScreenOf(xw); int pty = screen->respond; - Char Line[6]; - int line; if (IsBtnEvent(event)) { + int line; line = screen->cur_row - ((event->xbutton.y - screen->border) / FontHeight(screen)); + if (line != 0) { + Char Line[6]; + Line[0] = ANSI_ESC; /* force an exit from insert-mode */ v_write(pty, Line, 1); @@ -1229,8 +1236,6 @@ UTF8toLatin1(TScreen *screen, Char *s, unsigned long len, unsigned long *result) Cardinal offset = 0; - const Char *p; - if (len != 0) { PtyData data; @@ -1265,6 +1270,8 @@ UTF8toLatin1(TScreen *screen, Char *s, unsigned long len, unsigned long *result) * whatever the user wants). */ if (fails) { + const Char *p; + for (p = (const Char *) screen->default_string; *p != '\0'; ++p) { AddChar(&buffer, &used, offset, *p); } @@ -1524,13 +1531,12 @@ static Atom * _SelectionTargets(Widget w) { Atom *result; - TScreen *screen; XtermWidget xw; if ((xw = getXtermWidget(w)) == 0) { result = NULL; } else { - screen = TScreenOf(xw); + TScreen *screen = TScreenOf(xw); #if OPT_WIDE_CHARS if (screen->wide_chars) { @@ -1726,13 +1732,14 @@ xtermGetSelection(Widget w, } #endif } else { - struct _SelectionList *list; if (targets == NULL || targets[0] == None) { targets = _SelectionTargets(w); } if (targets != 0) { + struct _SelectionList *list; + target = targets[0]; if (targets[1] == None) { /* last target in list */ @@ -1840,11 +1847,10 @@ ToNational(TScreen *screen, Char *buffer, unsigned *length) { int gsetL = screen->gsets[screen->curgl]; int gsetR = screen->gsets[screen->curgr]; - unsigned chr, out, gl, gr; - Char *p; #if OPT_WIDE_CHARS if ((screen->utf8_nrc_mode | screen->utf8_mode) != uFalse) { + Char *p; PtyData *data = TypeXtMallocX(PtyData, *length); memset(data, 0, sizeof(*data)); @@ -1853,6 +1859,8 @@ ToNational(TScreen *screen, Char *buffer, unsigned *length) memcpy(data->buffer, buffer, (size_t) *length); p = buffer; while (data->next < data->last) { + unsigned chr, out, gl, gr; + if (!decodeUtf8(screen, data)) { data->utf_size = 1; data->utf_data = data->next[0]; @@ -1872,9 +1880,12 @@ ToNational(TScreen *screen, Char *buffer, unsigned *length) } else #endif { + Char *p; + for (p = buffer; (int) (p - buffer) < (int) *length; ++p) { - chr = *p; - out = chr; + unsigned gl, gr; + unsigned chr = *p; + unsigned out = chr; if ((gl = xtermCharSetIn(screen, chr, gsetL)) != chr) { out = gl; } else if ((gr = xtermCharSetIn(screen, chr, gsetR)) != chr) { @@ -1978,7 +1989,9 @@ _WriteSelectionData(XtermWidget xw, Char *line, size_t length) /* Doing this one line at a time may no longer be necessary because v_write has been re-written. */ +#if OPT_PASTE64 TScreen *screen = TScreenOf(xw); +#endif Char *lag, *end; /* in the VMS version, if tt_pasting isn't set to True then qio @@ -2049,11 +2062,11 @@ removeControls(XtermWidget xw, char *value) { TScreen *screen = TScreenOf(xw); size_t dst = 0; - size_t src = 0; if (screen->allowPasteControls) { dst = strlen(value); } else { + size_t src = 0; while ((value[dst] = value[src]) != '\0') { int ch = CharOf(value[src++]); if (ch < 32) { @@ -2098,7 +2111,7 @@ SelectionReceived(Widget w, int *format) { char **text_list = NULL; - int text_list_count; + int text_list_count = 0; XTextProperty text_prop; TScreen *screen; Display *dpy; @@ -2479,9 +2492,7 @@ EndExtend(XtermWidget xw, Bool use_cursor_loc) { CELL cell; - unsigned count; TScreen *screen = TScreenOf(xw); - Char line[64]; if (use_cursor_loc) { cell = screen->cursorp; @@ -2489,11 +2500,15 @@ EndExtend(XtermWidget xw, PointToCELL(screen, event->xbutton.y, event->xbutton.x, &cell); } ExtendExtend(xw, &cell); + screen->lastButtonUpTime = event->xbutton.time; screen->lastButton = event->xbutton.button; + if (!isSameCELL(&(screen->startSel), &(screen->endSel))) { if (screen->replyToEmacs) { - count = 0; + Char line[64]; + unsigned count = 0; + if (screen->control_eight_bits) { line[count++] = ANSI_CSI; } else { @@ -2863,10 +2878,10 @@ static int LastTextCol(TScreen *screen, CLineData *ld, int row) { int i = -1; - const IAttr *ch; if (ld != 0) { if (okScrnRow(screen, row)) { + const IAttr *ch; for (i = screen->max_col, ch = ld->attribs + i; i >= 0 && !(*ch & CHARDRAWN); @@ -3243,8 +3258,6 @@ do_select_regex(TScreen *screen, CELL *startc, CELL *endc) char *expr = screen->selectExpr[inx]; regex_t preg; regmatch_t match; - char *search; - int *indexed; TRACE(("Select_REGEX[%d]:%s\n", inx, NonNull(expr))); if (okPosition(screen, &ld, startc) && expr != 0) { @@ -3253,11 +3266,13 @@ do_select_regex(TScreen *screen, CELL *startc, CELL *endc) int lastRow = lastRowOfLine(screen, firstRow); unsigned size = lengthOfLines(screen, firstRow, lastRow); int actual = cellToColumn(screen, startc); + int *indexed; TRACE(("regcomp ok rows %d..%d bytes %d\n", firstRow, lastRow, size)); if ((indexed = TypeCallocN(int, size + 1)) != 0) { + char *search; if ((search = make_indexed_text(screen, firstRow, size, @@ -3355,7 +3370,6 @@ ComputeSelect(XtermWidget xw, { TScreen *screen = TScreenOf(xw); - int length; int cclass; CELL first = *startc; CELL last = *endc; @@ -3429,7 +3443,7 @@ ComputeSelect(XtermWidget xw, #endif if (okPosition(screen, &(ld.endSel), &(screen->endSel))) { - length = LastTextCol(screen, ld.endSel, screen->endSel.row); + int length = LastTextCol(screen, ld.endSel, screen->endSel.row); cclass = CClassOf(endSel); do { ++screen->endSel.col; @@ -3608,7 +3622,6 @@ ReHiliteText(XtermWidget xw, CELL *lastp) { TScreen *screen = TScreenOf(xw); - int i; CELL first = *firstp; CELL last = *lastp; @@ -3630,6 +3643,7 @@ ReHiliteText(XtermWidget xw, return; if (!isSameRow(&first, &last)) { /* do multiple rows */ + int i; if ((i = screen->max_col - first.col + 1) > 0) { /* first row */ ScrnRefresh(xw, first.row, first.col, 1, i, True); } @@ -3656,13 +3670,13 @@ SaltTextAway(XtermWidget xw, TScreen *screen = TScreenOf(xw); int i, j = 0; int eol; - int tmp; Char *line; Char *lp; CELL first = *cellc; CELL last = *cell; if (isSameRow(&first, &last) && first.col > last.col) { + int tmp; EXCHANGE(first.col, last.col, tmp); } @@ -3983,9 +3997,7 @@ ConvertSelection(Widget w, } if (*target == XA_TARGETS(dpy)) { - Atom *allocP; Atom *targetP; - Atom *std_targets; XPointer std_return = 0; unsigned long std_length; @@ -3993,6 +4005,8 @@ ConvertSelection(Widget w, target, type, &std_return, &std_length, format)) { Atom *my_targets = _SelectionTargets(w); + Atom *allocP; + Atom *std_targets; TRACE(("XmuConvertStandardSelection - success\n")); std_targets = (Atom *) (void *) (std_return); @@ -4341,7 +4355,6 @@ SaveText(TScreen *screen, { LineData *ld; int i = 0; - unsigned c; Char *result = lp; #if OPT_WIDE_CHARS unsigned previous = 0; @@ -4358,6 +4371,7 @@ SaveText(TScreen *screen, #endif *eol = !LineTstWrapped(ld); for (i = scol; i < ecol; i++) { + unsigned c; assert(i < (int) ld->lineSize); c = E2A(ld->charData[i]); #if OPT_WIDE_CHARS @@ -4371,10 +4385,9 @@ SaveText(TScreen *screen, are in memory attached to the HIDDEN_CHAR */ if_OPT_WIDE_CHARS(screen, { if ((screen->utf8_nrc_mode | screen->utf8_mode) != uFalse) { - unsigned ch; size_t off; for_each_combData(off, ld) { - ch = ld->combData[off][i]; + unsigned ch = ld->combData[off][i]; if (ch == 0) break; lp = convertToUTF8(lp, ch); @@ -4390,10 +4403,9 @@ SaveText(TScreen *screen, if ((screen->utf8_nrc_mode | screen->utf8_mode) != uFalse) { lp = convertToUTF8(lp, (c != 0) ? c : ' '); if_OPT_WIDE_CHARS(screen, { - unsigned ch; size_t off; for_each_combData(off, ld) { - ch = ld->combData[off][i]; + unsigned ch = ld->combData[off][i]; if (ch == 0) break; lp = convertToUTF8(lp, ch); @@ -4827,13 +4839,12 @@ static char ** tokenizeFormat(String format) { char **result = 0; - int pass; int argc; - int n; format = x_skip_blanks(format); if (*format != '\0') { char *blob = x_strdup(format); + int pass; for (pass = 0; pass < 2; ++pass) { int used = 0; @@ -4841,6 +4852,7 @@ tokenizeFormat(String format) int escaped = 0; int squoted = 0; int dquoted = 0; + int n; argc = 0; for (n = 0; format[n] != '\0'; ++n) { @@ -4998,9 +5010,10 @@ expandFormat(XtermWidget xw, size_t need = 0; for (n = 0; format[n] != '\0'; ++n) { - char *value = 0; if (format[n] == '%') { + char *value = 0; + switch (format[++n]) { case '%': if (pass) { @@ -5089,10 +5102,10 @@ expandFormat(XtermWidget xw, static void executeCommand(pid_t pid, char **argv) { - char *child_cwd = ProcGetCWD(pid); - (void) pid; if (argv != 0 && argv[0] != 0) { + char *child_cwd = ProcGetCWD(pid); + if (fork() == 0) { if (child_cwd) { IGNORE_RC(chdir(child_cwd)); /* We don't care if this fails */ @@ -5106,11 +5119,10 @@ executeCommand(pid_t pid, char **argv) static void freeArgv(char *blob, char **argv) { - int n; - if (blob) { free(blob); if (argv) { + int n; for (n = 0; argv[n]; ++n) free(argv[n]); free(argv); @@ -5125,11 +5137,11 @@ reallyExecFormatted(Widget w, char *format, char *data, CELL *start, CELL *finis if ((xw = getXtermWidget(w)) != 0) { char **argv; - char *blob; - int argc; if ((argv = tokenizeFormat(format)) != 0) { - blob = argv[0]; + char *blob = argv[0]; + int argc; + for (argc = 0; argv[argc] != 0; ++argc) { argv[argc] = expandFormat(xw, argv[argc], data, start, finish); } @@ -5169,13 +5181,13 @@ HandleExecSelectable(Widget w, CELL start, finish; char *data; char **argv; - char *blob; - int argc; data = getDataFromScreen(xw, params[1], &start, &finish); if (data != 0) { if ((argv = tokenizeFormat(params[0])) != 0) { - blob = argv[0]; + char *blob = argv[0]; + int argc; + for (argc = 0; argv[argc] != 0; ++argc) { argv[argc] = expandFormat(xw, argv[argc], data, &start, &finish); @@ -5235,11 +5247,10 @@ HandleInsertSelectable(Widget w, CELL start, finish; char *data; char *temp = x_strdup(params[0]); - char *exps; data = getDataFromScreen(xw, params[1], &start, &finish); if (data != 0) { - exps = expandFormat(xw, temp, data, &start, &finish); + char *exps = expandFormat(xw, temp, data, &start, &finish); if (exps != 0) { unparseputs(xw, exps); unparse_end(xw); diff --git a/cachedGCs.c b/cachedGCs.c index 2b346b7..84b74f2 100644 --- a/cachedGCs.c +++ b/cachedGCs.c @@ -1,7 +1,7 @@ -/* $XTermId: cachedGCs.c,v 1.63 2014/12/18 21:56:08 tom Exp $ */ +/* $XTermId: cachedGCs.c,v 1.64 2016/05/16 09:26:15 tom Exp $ */ /* - * Copyright 2007-2011,2014 by Thomas E. Dickey + * Copyright 2007-2014,2016 by Thomas E. Dickey * * All Rights Reserved * @@ -527,12 +527,12 @@ setCgsFont(XtermWidget xw, VTwin *cgsWin, CgsEnum cgsId, XTermFonts * font) void clrCgsFonts(XtermWidget xw, VTwin *cgsWin, XTermFonts * font) { - CgsCache *me; - int j, k; - if (HaveFont(font)) { + int j; for_each_gc(j) { + CgsCache *me; if ((me = myCache(xw, cgsWin, (CgsEnum) j)) != 0) { + int k;