xterm: Changes to 'upstream-unstable'
Imakefile | 20 +++-
MANIFEST | 2
Makefile.in | 26 ++++--
NEWS | 22 +++++
Tekparse.h | 90 +++++----------------
VTparse.h | 200 -----------------------------------------------
charproc.c | 17 ++-
ctlseqs.ms | 8 -
ctlseqs.txt | 6 -
main.c | 169 +++++++++++++++++++++++++++++++++++----
misc.c | 8 -
package/debian/changelog | 6 +
package/freebsd/Makefile | 2
package/xterm.spec | 4
ptyx.h | 9 +-
trace.c | 42 +++++++++
trace.h | 4
util.c | 8 -
version.h | 6 -
xterm.log.html | 36 ++++++++
xterm.man | 8 +
21 files changed, 374 insertions(+), 319 deletions(-)
New commits:
commit 1a027e1ec651c4298f19f92a8fdef55225e4049c
Author: Sven Joachim <svenjoac@gmx.de>
Date: Sat Oct 8 08:40:13 2016 +0200
Imported Upstream version 327
diff --git a/Imakefile b/Imakefile
index bbe389a..daf250e 100644
--- a/Imakefile
+++ b/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XTermId: Imakefile,v 1.112 2016/01/28 01:56:53 Jens.Schweikhardt Exp $
+XCOMM $XTermId: Imakefile,v 1.113 2016/10/06 00:56:32 tom Exp $
XCOMM
XCOMM Attention xterm porters
XCOMM
@@ -244,11 +244,21 @@ TERMCAPDEFINES=-DUSE_TERMINFO -DHAVE_TIGETSTR
AllTarget($(PROGRAMS))
+VTPARSE_H = VTparse.h VTparse.hin
+TEKPARSE_H = Tekparse.h Tekparse.hin
+
+.SUFFIXES : .def .hin
+.def.hin :
+ awk '/^CASE_/{printf "#define %s %d\n", $$1, n++}' < $< >$@
+
SpecialCObjectRule(main,$(_NOOP_),$(MAIN_DEFINES))
SpecialCObjectRule(menu,$(_NOOP_),$(MISC_DEFINES))
-SpecialCObjectRule(misc,$(_NOOP_),$(MISC_DEFINES))
-SpecialCObjectRule(charproc,$(_NOOP_),$(MISC_DEFINES))
+SpecialCObjectRule(misc,$(VTPARSE_H),$(MISC_DEFINES))
+SpecialCObjectRule(VTPrsTbl,$(VTPARSE_H),$(MISC_DEFINES))
+SpecialCObjectRule(charproc,$(VTPARSE_H),$(MISC_DEFINES))
SpecialCObjectRule(data,$(_NOOP_),$(MISC_DEFINES))
+SpecialCObjectRule(TekPrsTbl,$(TEKPARSE_H),$(MISC_DEFINES))
+SpecialCObjectRule(TekProc,$(TEKPARSE_H),$(MISC_DEFINES))
#if InstallXtermSetUID
SetUIDProgramTarget(xterm,$(OBJS1),$(DEPLIBS1),$(XRFLIBS) XkbClientLibs XawClientLibs,$(TERMCAPLIB) $(PTYLIB))
@@ -319,4 +329,8 @@ InstallAppDefaults(UXTerm)
InstallAppDefaultsLong(XTerm-col,XTerm-color)
InstallManPage(xterm,$(MANDIR))
InstallManPage(resize,$(MANDIR))
+
+cleandir::
+ $(RM) *parse.hin
+
DependTarget()
diff --git a/MANIFEST b/MANIFEST
index 9f99009..bd690d0 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,4 @@
-MANIFEST for xterm-326, version xterm-326
+MANIFEST for xterm-327, version xterm-327
--------------------------------------------------------------------------------
MANIFEST this file
256colres.h resource-definitions for 256-color mode
diff --git a/Makefile.in b/Makefile.in
index 17b273d..5fcbfab 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
-## $XTermId: Makefile.in,v 1.235 2016/05/15 16:45:53 tom Exp $
+## $XTermId: Makefile.in,v 1.238 2016/10/06 00:28:15 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
@@ -125,7 +125,7 @@ EXTRAOBJ = @EXTRAOBJS@
all : $(PROGRAMS)
################################################################################
-.SUFFIXES : .i .def .hin .$(manext) .ms .man .txt @MAN2HTML_NOTE@ .html @GROFF_NOTE@ .ps .pdf
+.SUFFIXES : .i .def .cin .hin .$(manext) .ms .man .txt @MAN2HTML_NOTE@ .html @GROFF_NOTE@ .ps .pdf
.c$o :
@RULE_CC@
@@ -135,8 +135,11 @@ all : $(PROGRAMS)
@RULE_CC@
@ECHO_CC@$(CPP) -C $(CPPFLAGS) $*.c >$@
+.def.cin :
+ $(AWK) '/^CASE_/{printf "{ %d, \"%s\" },\n", n++, $$1; }' < $< >$@
+
.def.hin :
- grep '^CASE_' $< | $(AWK) '{printf "#define %s %d\n", $$1, n++}' >$@
+ $(AWK) '/^CASE_/{printf "#define %s %d\n", $$1, n++}' < $< >$@
.man.$(manext) :
$(SHELL) ./minstall "$(INSTALL_DATA)" $< $@ $(appsdir) $(CLASS) $* $* $(pixmapdir)
@@ -169,6 +172,10 @@ all : $(PROGRAMS)
@GROFF_NOTE@.ps.pdf :
@GROFF_NOTE@ ps2pdf $*.ps
################################################################################
+
+VTPARSE_H = VTparse.h VTparse.hin
+TEKPARSE_H = Tekparse.h Tekparse.hin
+
main$o : main.h
misc$o : version.h
@@ -189,10 +196,19 @@ resize$x : $(OBJS2)
-$(RM) $@
perl $(srcdir)/88colres.pl > $@
-charproc$o : main.h @CHARPROC_DEPS@
+charproc$o : $(VTPARSE_H) main.h @CHARPROC_DEPS@
+graphics_regis$o : $(VTPARSE_H)
+graphics_sixel$o : $(VTPARSE_H)
+misc$o : $(VTPARSE_H)
+VTPrsTbl$o : $(VTPARSE_H)
+
+TekPrsTbl$o : $(TEKPARSE_H)
+Tekproc$o : $(TEKPARSE_H)
misc$o : builtin_icons.h
+trace$o : VTparse.cin Tekparse.cin
+
# do this to quiet gcc -Wcast-qual warnings
builtin_icons.h :
@echo "#if OPT_BUILTIN_XPMS" >$@
@@ -500,7 +516,7 @@ mostlyclean :
-$(RM) *$o *.[is] XtermLog.* .pure core *~ *.bak *.BAK *.out *.tmp
clean : mostlyclean
- -$(RM) $(PROGRAMS) builtin_icons.h
+ -$(RM) $(PROGRAMS) builtin_icons.h *.cin *parse.hin
distclean :: clean
-$(RM) Makefile config.status config.cache config.log xtermcfg.h
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..0fa030a
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,22 @@
+The NEWS file was generated from xterm.log.html, which serves as the changelog
+for xterm.
+--------------------------------------------------------------------------------
+ Patch #327 - 2016/10/07
+
+ * add a check in the function which handles end-of-line wrapping to
+ ensure that C1 controls are allocated one column when
+ allowC1Printable is set (Debian #738794).
+ * use consistent error-checking after strtol calls, fixes a case
+ where a query with OSC 6 did not ensure there was a valid color
+ number (report by Alex Smith).
+ * add -baudrate option, for testing ncurses.
+ * always generate the CASE_xxx symbols in VTparse.h and Tekparse.h,
+ as part of a change to improve debug-logging. This makes the build
+ always depend upon awk.
+ * modify allowC1Printable to disallow codes 160-254 as being
+ equivalent to codes 32-126 when parsing escape sequences (Debian
+ #839220).
+ * amend fix from patch #326 for TrueType fonts to exclude the hidden
+ character used for double-width cells (report by Grady Martin).
+ * fix a typo in ctlseqs.ms
+
diff --git a/Tekparse.h b/Tekparse.h
index 9c706ce..aac9851 100644
--- a/Tekparse.h
+++ b/Tekparse.h
@@ -1,31 +1,34 @@
-/* $XTermId: Tekparse.h,v 1.7 2006/02/13 01:14:57 tom Exp $ */
+/* $XTermId: Tekparse.h,v 1.8 2016/10/06 00:32:30 tom Exp $ */
/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ * Copyright 1998-2006,2016 by Thomas E. Dickey
*
* All Rights Reserved
*
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
*
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
*
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization.
*/
-/* $XFree86: xc/programs/xterm/Tekparse.h,v 1.6 2006/02/13 01:14:57 dickey Exp $ */
-
-
-/* @(#)Tekparse.h X10/6.6 11/7/86 */
#ifndef included_Tekparse_h
#define included_Tekparse_h 1
@@ -47,51 +50,6 @@ extern Const int Tplttable[];
extern Const int Tpttable[];
extern Const int Tspttable[];
-/*
- * The following list of definitions is generated from Tekparse.def using the
- * following command line:
- *
- * egrep -v '^CASE_' Tekparse.def | \
- * awk 'BEGIN {n = 0;} {printf "#define %s %d\n", $1, n; n++}'
- *
- * You you need to change something, change Tekparse.def and regenerate the
- * definitions. This would have been automatic, but since this doesn't change
- * very often, it isn't worth the makefile hassle.
- */
-
-#define CASE_REPORT 0
-#define CASE_VT_MODE 1
-#define CASE_SPT_STATE 2
-#define CASE_GIN 3
-#define CASE_BEL 4
-#define CASE_BS 5
-#define CASE_PT_STATE 6
-#define CASE_PLT_STATE 7
-#define CASE_TAB 8
-#define CASE_IPL_STATE 9
-#define CASE_ALP_STATE 10
-#define CASE_UP 11
-#define CASE_COPY 12
-#define CASE_PAGE 13
-#define CASE_BES_STATE 14
-#define CASE_BYP_STATE 15
-#define CASE_IGNORE 16
-#define CASE_ASCII 17
-#define CASE_APL 18
-#define CASE_CHAR_SIZE 19
-#define CASE_BEAM_VEC 20
-#define CASE_CURSTATE 21
-#define CASE_PENUP 22
-#define CASE_PENDOWN 23
-#define CASE_IPL_POINT 24
-#define CASE_PLT_VEC 25
-#define CASE_PT_POINT 26
-#define CASE_SPT_POINT 27
-#define CASE_CR 28
-#define CASE_ESC_STATE 29
-#define CASE_LF 30
-#define CASE_SP 31
-#define CASE_PRINT 32
-#define CASE_OSC 33
+#include <Tekparse.hin>
#endif /* included_Tekparse_h */
diff --git a/VTparse.h b/VTparse.h
index 7f9170e..316e0c4 100644
--- a/VTparse.h
+++ b/VTparse.h
@@ -1,7 +1,7 @@
-/* $XTermId: VTparse.h,v 1.65 2015/02/16 00:10:39 tom Exp $ */
+/* $XTermId: VTparse.h,v 1.66 2016/10/06 00:37:11 tom Exp $ */
/*
- * Copyright 2002-2014,2015 by Thomas E. Dickey
+ * Copyright 1996-2015,2016 by Thomas E. Dickey
*
* All Rights Reserved
*
@@ -28,28 +28,6 @@
* holders shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization.
- *
- *
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
*/
#ifndef included_VTparse_h
@@ -106,178 +84,6 @@ extern Const PARSE_T esc_pct_table[];
extern Const PARSE_T scs_pct_table[];
#endif
-/*
- * The following list of definitions is generated from VTparse.def using the
- * following command line:
- *
- * grep '^CASE_' VTparse.def | awk '{printf "#define %s %d\n", $1, n++}'
- *
- * If you need to change something, change VTparse.def and regenerate the
- * definitions. This would have been automatic, but since this doesn't change
- * very often, it isn't worth the makefile hassle.
- */
-
-#define CASE_GROUND_STATE 0
-#define CASE_IGNORE 1
-#define CASE_BELL 2
-#define CASE_BS 3
-#define CASE_CR 4
-#define CASE_ESC 5
-#define CASE_VMOT 6
-#define CASE_TAB 7
-#define CASE_SI 8
-#define CASE_SO 9
-#define CASE_SCR_STATE 10
-#define CASE_SCS0_STATE 11
-#define CASE_SCS1_STATE 12
-#define CASE_SCS2_STATE 13
-#define CASE_SCS3_STATE 14
-#define CASE_ESC_IGNORE 15
-#define CASE_ESC_DIGIT 16
-#define CASE_ESC_SEMI 17
-#define CASE_DEC_STATE 18
-#define CASE_ICH 19
-#define CASE_CUU 20
-#define CASE_CUD 21
-#define CASE_CUF 22
-#define CASE_CUB 23
-#define CASE_CUP 24
-#define CASE_ED 25
-#define CASE_EL 26
-#define CASE_IL 27
-#define CASE_DL 28
-#define CASE_DCH 29
-#define CASE_DA1 30
-#define CASE_TRACK_MOUSE 31
-#define CASE_TBC 32
-#define CASE_SET 33
-#define CASE_RST 34
-#define CASE_SGR 35
-#define CASE_CPR 36
-#define CASE_DECSTBM 37
-#define CASE_DECREQTPARM 38
-#define CASE_DECSET 39
-#define CASE_DECRST 40
-#define CASE_DECALN 41
-#define CASE_GSETS 42
-#define CASE_DECSC 43
-#define CASE_DECRC 44
-#define CASE_DECKPAM 45
-#define CASE_DECKPNM 46
-#define CASE_IND 47
-#define CASE_NEL 48
-#define CASE_HTS 49
-#define CASE_RI 50
-#define CASE_SS2 51
-#define CASE_SS3 52
-#define CASE_CSI_STATE 53
-#define CASE_OSC 54
-#define CASE_RIS 55
-#define CASE_LS2 56
-#define CASE_LS3 57
-#define CASE_LS3R 58
-#define CASE_LS2R 59
-#define CASE_LS1R 60
-#define CASE_PRINT 61
-#define CASE_XTERM_SAVE 62
-#define CASE_XTERM_RESTORE 63
-#define CASE_XTERM_TITLE 64
-#define CASE_DECID 65
-#define CASE_HP_MEM_LOCK 66
-#define CASE_HP_MEM_UNLOCK 67
-#define CASE_HP_BUGGY_LL 68
-#define CASE_HPA 69
-#define CASE_VPA 70
-#define CASE_XTERM_WINOPS 71
-#define CASE_ECH 72
-#define CASE_CHT 73
-#define CASE_CPL 74
-#define CASE_CNL 75
-#define CASE_CBT 76
-#define CASE_SU 77
-#define CASE_SD 78
-#define CASE_S7C1T 79
-#define CASE_S8C1T 80
-#define CASE_ESC_SP_STATE 81
-#define CASE_ENQ 82
-#define CASE_DECSCL 83
-#define CASE_DECSCA 84
-#define CASE_DECSED 85
-#define CASE_DECSEL 86
-#define CASE_DCS 87
-#define CASE_PM 88
-#define CASE_SOS 89
-#define CASE_ST 90
-#define CASE_APC 91
-#define CASE_EPA 92
-#define CASE_SPA 93
-#define CASE_CSI_QUOTE_STATE 94
-#define CASE_DSR 95
-#define CASE_ANSI_LEVEL_1 96
-#define CASE_ANSI_LEVEL_2 97
-#define CASE_ANSI_LEVEL_3 98
-#define CASE_MC 99
-#define CASE_DEC2_STATE 100
-#define CASE_DA2 101
-#define CASE_DEC3_STATE 102
-#define CASE_DECRPTUI 103
-#define CASE_VT52_CUP 104
-#define CASE_REP 105
-#define CASE_CSI_EX_STATE 106
-#define CASE_DECSTR 107
-#define CASE_DECDHL 108
-#define CASE_DECSWL 109
-#define CASE_DECDWL 110
-#define CASE_DEC_MC 111
-#define CASE_ESC_PERCENT 112
-#define CASE_UTF8 113
-#define CASE_CSI_TICK_STATE 114
-#define CASE_DECELR 115
-#define CASE_DECRQLP 116
-#define CASE_DECEFR 117
-#define CASE_DECSLE 118
-#define CASE_CSI_IGNORE 119
-#define CASE_VT52_IGNORE 120
-#define CASE_VT52_FINISH 121
-#define CASE_CSI_DOLLAR_STATE 122
-#define CASE_DECCRA 123
-#define CASE_DECERA 124
-#define CASE_DECFRA 125
-#define CASE_DECSERA 126
-#define CASE_DECSACE 127
-#define CASE_DECCARA 128
-#define CASE_DECRARA 129
-#define CASE_CSI_STAR_STATE 130
-#define CASE_SET_MOD_FKEYS 131
-#define CASE_SET_MOD_FKEYS0 132
-#define CASE_HIDE_POINTER 133
-#define CASE_SCS1A_STATE 134
-#define CASE_SCS2A_STATE 135
-#define CASE_SCS3A_STATE 136
-#define CASE_CSI_SPACE_STATE 137
-#define CASE_DECSCUSR 138
-#define CASE_SM_TITLE 139
-#define CASE_RM_TITLE 140
-#define CASE_DECSMBV 141
-#define CASE_DECSWBV 142
-#define CASE_DECLL 143
-#define CASE_DECRQM 144
-#define CASE_RQM 145
-#define CASE_CSI_DEC_DOLLAR_STATE 146
-#define CASE_SL 147
-#define CASE_SR 148
-#define CASE_DECDC 149
-#define CASE_DECIC 150
-#define CASE_DECBI 151
-#define CASE_DECFI 152
-#define CASE_DECRQCRA 153
-#define CASE_HPR 154
-#define CASE_VPR 155
-#define CASE_ANSI_SC 156
-#define CASE_ANSI_RC 157
-#define CASE_ESC_COLON 158
-#define CASE_SCS_PERCENT 159
-#define CASE_GSETS_PERCENT 160
-#define CASE_GRAPHICS_ATTRIBUTES 161
+#include <VTparse.hin>
#endif /* included_VTparse_h */
diff --git a/charproc.c b/charproc.c
index bc103db..983ec6f 100644
--- a/charproc.c
+++ b/charproc.c
@@ -1,4 +1,4 @@
-/* $XTermId: charproc.c,v 1.1422 2016/09/23 20:13:11 tom Exp $ */
+/* $XTermId: charproc.c,v 1.1426 2016/10/07 21:14:54 tom Exp $ */
/*
* Copyright 1999-2015,2016 by Thomas E. Dickey
@@ -2110,10 +2110,13 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
* provided that they are not intermixed with an escape sequence.
*/
if (screen->c1_printable
- && (c >= 128 && c < 160)) {
+ && (c >= 128 && c < 256)) {
sp->nextstate = (sp->parsestate == esc_table
? CASE_ESC_IGNORE
: sp->parsestate[E2A(160)]);
+ TRACE(("allowC1Printable %04X %s ->%s\n",
+ c, which_table(sp->parsestate),
+ visibleVTparse(sp->nextstate)));
}
#endif
@@ -2216,8 +2219,8 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
}
DumpParams();
- TRACE(("parse %04X -> %d %s (used=%lu)\n",
- c, sp->nextstate,
+ TRACE(("parse %04X -> %s %s (used=%lu)\n",
+ c, visibleVTparse(sp->nextstate),
which_table(sp->parsestate),
(unsigned long) sp->string_used));
@@ -4992,6 +4995,10 @@ dotext(XtermWidget xw,
if (!screen->utf8_mode
|| (screen->vt100_graphics && charset == '0')) {
last_chomp = 1;
+ } else if (screen->c1_printable &&
+ buf[chars_chomped + offset] >= 0x80 &&
+ buf[chars_chomped + offset] <= 0xa0) {
+ last_chomp = 1;
} else {
last_chomp = my_wcwidth((wchar_t) buf[chars_chomped + offset]);
}
@@ -7554,7 +7561,7 @@ set_flags_from_list(char *target,
char *temp;
value = (int) strtol(next, &temp, 0);
- if (!IsEmpty(temp)) {
+ if (!FullS2L(next, temp)) {
xtermWarning("Expected a number: %s\n", next);
} else {
for (n = 0; n < limit; ++n) {
diff --git a/ctlseqs.ms b/ctlseqs.ms
index cedc426..f35c612 100644
--- a/ctlseqs.ms
+++ b/ctlseqs.ms
@@ -1,6 +1,6 @@
.\"#! troff -ms $1 -*- Nroff -*-
.\" "Xterm Control Sequences" document
-.\" $XTermId: ctlseqs.ms,v 1.331 2016/09/08 09:16:28 tom Exp $
+.\" $XTermId: ctlseqs.ms,v 1.333 2016/10/02 23:19:00 tom Exp $
.\"
.\"
.\" Copyright 1996-2015,2016 by Thomas E. Dickey
@@ -70,7 +70,7 @@
.ds XT XTerm
.ds xt xterm
.ds LF Patch #326
-.ds RF 2016/09/08
+.ds RF 2016/10/02
.\"
.if n .pl 9999v \" no page breaks in nroff
.ND
@@ -679,7 +679,7 @@ Invoke the G1 Character Set as GR (LS1R).
.Ed
.
.St
-.Ss Application Program-Control functions
+.Ss Application Program-Command functions
.IP \\*(AP\\*(Pt\\*s\\*(ST
None. \fIxterm\fP implements no \*(AP functions; \*(Pt is ignored.
\*(Pt need not be printable characters.
@@ -1633,7 +1633,7 @@ Delete \*(Ps Column(s) (default = 1) (DECDC), VT420 and up.
.Ed
.
.St
-.Ss Operating System Controls
+.Ss Operating System Commands
.
.IP \\*(Os\\*(Ps\\*s\\*;\\*(Pt\\*s\\*(ST
.IP \\*(Os\\*(Ps\\*s\\*;\\*(Pt\\*s\\*(Be
diff --git a/ctlseqs.txt b/ctlseqs.txt
index 428f164..932744e 100644
--- a/ctlseqs.txt
+++ b/ctlseqs.txt
@@ -21,7 +21,7 @@
Thomas Dickey
XFree86 Project (1996-2006)
invisible-island.net (2006-2016)
- updated for XTerm Patch #326 (2016/09/08)
+ updated for XTerm Patch #326 (2016/10/02)
@@ -241,7 +241,7 @@ ESC | Invoke the G3 Character Set as GR (LS3R).
ESC } Invoke the G2 Character Set as GR (LS2R).
ESC ~ Invoke the G1 Character Set as GR (LS1R).
-Application Program-Control functions
+Application Program-Command functions
APC Pt ST None. xterm implements no APC functions; Pt is ignored. Pt
need not be printable characters.
@@ -1037,7 +1037,7 @@ CSI Pm ' }
CSI Pm ' ~
Delete Ps Column(s) (default = 1) (DECDC), VT420 and up.
-Operating System Controls
+Operating System Commands
OSC Ps ; Pt ST
OSC Ps ; Pt BEL
Set Text Parameters. For colors and font, if Pt is a "?", the
diff --git a/main.c b/main.c
index ce50c69..8ea0bdb 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $XTermId: main.c,v 1.781 2016/06/01 09:13:46 tom Exp $ */
+/* $XTermId: main.c,v 1.784 2016/10/07 00:40:34 tom Exp $ */
/*
* Copyright 2002-2015,2016 by Thomas E. Dickey
@@ -445,7 +445,8 @@ extern char *ptsname(int);
#ifndef VMS
static void reapchild(int /* n */ );
-static int spawnXTerm(XtermWidget /* xw */ );
+static int spawnXTerm(XtermWidget /* xw */
+ ,unsigned /* line_speed */ );
static void remove_termcap_entry(char *, const char *);
#ifdef USE_PTY_SEARCH
static int pty_search(int * /* pty */ );
@@ -1115,6 +1116,7 @@ static XrmOptionDescRec optionDescList[] = {
/* options that we process ourselves */
{"-help", NULL, XrmoptionSkipNArgs, (XPointer) NULL},
{"-version", NULL, XrmoptionSkipNArgs, (XPointer) NULL},
+{"-baudrate", NULL, XrmoptionSkipArg, (XPointer) NULL},
{"-class", NULL, XrmoptionSkipArg, (XPointer) NULL},
{"-e", NULL, XrmoptionSkipLine, (XPointer) NULL},
{"-into", NULL, XrmoptionSkipArg, (XPointer) NULL},
@@ -1159,6 +1161,7 @@ static OptionHelp xtermOptions[] = {
#endif
{ "-iconic", "start iconic" },
{ "-name string", "client instance, icon, and title strings" },
+{ "-baudrate rate", "set line-speed (default 38400)" },
{ "-class string", "class string (XTerm)" },
{ "-title string", "title string" },
{ "-xrm resourcestring", "additional resource specifications" },
@@ -1357,9 +1360,10 @@ decode_keyvalue(char **ptr, int termcap)
}
++string;
} else if (termcap && (*string == '\\')) {
+ char *s = (string + 1);
char *d;
- int temp = (int) strtol(string + 1, &d, 8);
- if (temp > 0 && d != string) {
+ int temp = (int) strtol(s, &d, 8);
+ if (PartS2L(s, d) && temp > 0) {
value = temp;
string = d;
}
@@ -1971,6 +1975,124 @@ complex_command(char **args)
}
#endif
+static unsigned
+lookup_baudrate(const char *value)
+{
+ struct speed {
+ unsigned given_speed; /* values for 'ospeed' */
+ unsigned actual_speed; /* the actual speed */
+ };
+
+#define DATA(number) { B##number, number }
+
+ static struct speed const speeds[] =
+ {
+ DATA(0),
+ DATA(50),
+ DATA(75),
+ DATA(110),
+ DATA(134),
+ DATA(150),
+ DATA(200),
+ DATA(300),
+ DATA(600),
+ DATA(1200),
+ DATA(1800),
+ DATA(2400),
+ DATA(4800),
+ DATA(9600),
+#ifdef B19200
+ DATA(19200),
+#elif defined(EXTA)
+ {EXTA, 19200},
+#endif
+#ifdef B28800
+ DATA(28800),
+#endif
+#ifdef B38400
+ DATA(38400),
+#elif defined(EXTB)
+ {EXTB, 38400},
+#endif
+#ifdef B57600
+ DATA(57600),
+#endif
+#ifdef B76800
+ DATA(76800),
+#endif
+#ifdef B115200
+ DATA(115200),
+#endif
+#ifdef B153600
+ DATA(153600),
+#endif
+#ifdef B230400
+ DATA(230400),
+#endif
+#ifdef B307200
+ DATA(307200),
+#endif
+#ifdef B460800
+ DATA(460800),
+#endif
+#ifdef B500000
+ DATA(500000),
+#endif
+#ifdef B576000
+ DATA(576000),
+#endif
+#ifdef B921600
+ DATA(921600),
+#endif
+#ifdef B1000000
+ DATA(1000000),
+#endif
+#ifdef B1152000
+ DATA(1152000),
+#endif
+#ifdef B1500000
+ DATA(1500000),
+#endif
+#ifdef B2000000
+ DATA(2000000),
+#endif
+#ifdef B2500000
+ DATA(2500000),
+#endif
+#ifdef B3000000
+ DATA(3000000),
+#endif
+#ifdef B3500000
+ DATA(3500000),
+#endif
+#ifdef B4000000
+ DATA(4000000),
+#endif
+ };
+#undef DATA
+ unsigned result = 0;
+ long check;
+ char *next;
+ if (x_toupper(*value) == 'B')
+ value++;
+ if (isdigit(CharOf(*value))) {
+ check = strtol(value, &next, 10);
+ if (FullS2L(value, next) && (check > 0)) {
+ Cardinal n;
+ for (n = 0; n < XtNumber(speeds); ++n) {
+ if (speeds[n].actual_speed == (unsigned) check) {
+ result = speeds[n].given_speed;
+ break;
+ }
+ }
+ }
+ }
+ if (result == 0) {
+ fprintf(stderr, "unsupported value for baudrate: %s\n", value);
+ }
+ return result;
+}
+
int
main(int argc, char *argv[]ENVP_ARG)
{
@@ -1989,6 +2111,7 @@ main(int argc, char *argv[]ENVP_ARG)
TScreen *screen;
int mode;
char *my_class = x_strdup(DEFCLASS);
+ unsigned line_speed = VAL_LINE_SPEED;
Window winToEmbedInto = None;
ProgramName = argv[0];
@@ -2070,6 +2193,11 @@ main(int argc, char *argv[]ENVP_ARG)
} else if (!strcmp(option_ptr->option, "-help")) {
Help();
quit = True;
+ } else if (!strcmp(option_ptr->option, "-baudrate")) {
+ if ((line_speed = lookup_baudrate(option_value)) == 0) {
+ Help();
+ quit = True;
+ }
} else if (!strcmp(option_ptr->option, "-class")) {
free(my_class);
if ((my_class = x_strdup(option_value)) == 0) {
@@ -2079,6 +2207,10 @@ main(int argc, char *argv[]ENVP_ARG)
} else if (!strcmp(option_ptr->option, "-into")) {
char *endPtr;
winToEmbedInto = (Window) strtol(option_value, &endPtr, 0);
+ if (!FullS2L(option_value, endPtr)) {
+ Help();
+ quit = True;
+ }
}
}
if (quit)
@@ -2126,7 +2258,7 @@ main(int argc, char *argv[]ENVP_ARG)
}
}
#if defined(macII) || defined(ATT) || defined(CRAY) /* { */
- d_tio.c_cflag = VAL_LINE_SPEED | CS8 | CREAD | PARENB | HUPCL;
+ d_tio.c_cflag = line_speed | CS8 | CREAD | PARENB | HUPCL;
d_tio.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK;
#ifdef ECHOKE
d_tio.c_lflag |= ECHOKE | IEXTEN;
@@ -2153,12 +2285,12 @@ main(int argc, char *argv[]ENVP_ARG)
#ifdef BAUD_0 /* { */
d_tio.c_cflag = CS8 | CREAD | PARENB | HUPCL;
#else /* }{ !BAUD_0 */
- d_tio.c_cflag = VAL_LINE_SPEED | CS8 | CREAD | PARENB | HUPCL;
+ d_tio.c_cflag = line_speed | CS8 | CREAD | PARENB | HUPCL;
#endif /* } !BAUD_0 */
#else /* USE_POSIX_TERMIOS */
d_tio.c_cflag = CS8 | CREAD | PARENB | HUPCL;
- cfsetispeed(&d_tio, VAL_LINE_SPEED);
- cfsetospeed(&d_tio, VAL_LINE_SPEED);
+ cfsetispeed(&d_tio, line_speed);
+ cfsetospeed(&d_tio, line_speed);
#endif
d_tio.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK;
#ifdef ECHOKE
@@ -2349,6 +2481,11 @@ main(int argc, char *argv[]ENVP_ARG)
debug = True;
continue;
#endif /* DEBUG */
+ case 'b':
+ if (strcmp(argv[0], "-baudrate"))
+ Syntax(*argv);
+ argc--, argv++;
+ continue;
case 'c':
if (strcmp(argv[0], "-class"))
Syntax(*argv);
@@ -2506,7 +2643,7 @@ main(int argc, char *argv[]ENVP_ARG)
}
});
- spawnXTerm(term);
+ spawnXTerm(term, line_speed);
#ifndef VMS
/* Child process is out there, let's catch its termination */
@@ -3304,7 +3441,7 @@ resetShell(char *oldPath)
* If slave, the pty named in passedPty is already open for use
*/
static int
-spawnXTerm(XtermWidget xw)
+spawnXTerm(XtermWidget xw, unsigned line_speed)
{
TScreen *screen = TScreenOf(xw);
Cardinal nn;
@@ -4009,13 +4146,13 @@ spawnXTerm(XtermWidget xw)
#ifdef BAUD_0
/* baud rate is 0 (don't care) */
#elif defined(HAVE_TERMIO_C_ISPEED)
- tio.c_ispeed = tio.c_ospeed = VAL_LINE_SPEED;
+ tio.c_ispeed = tio.c_ospeed = line_speed;
#else /* !BAUD_0 */
- tio.c_cflag |= VAL_LINE_SPEED;
+ tio.c_cflag |= line_speed;
#endif /* !BAUD_0 */
#else /* USE_POSIX_TERMIOS */
- cfsetispeed(&tio, VAL_LINE_SPEED);
- cfsetospeed(&tio, VAL_LINE_SPEED);
+ cfsetispeed(&tio, line_speed);
+ cfsetospeed(&tio, line_speed);
#ifdef __MVS__
/* turn off bits that can't be set from the slave side */
tio.c_cflag &= ~(PACKET | PKT3270 | PTU3270 | PKTXTND);
@@ -4096,8 +4233,8 @@ spawnXTerm(XtermWidget xw)
sg.sg_flags &= ~(ALLDELAY | XTABS | CBREAK | RAW);
sg.sg_flags |= ECHO | CRMOD;
/* make sure speed is set on pty so that editors work right */
- sg.sg_ispeed = VAL_LINE_SPEED;
- sg.sg_ospeed = VAL_LINE_SPEED;
+ sg.sg_ispeed = line_speed;
+ sg.sg_ospeed = line_speed;
/* reset t_brkc to default value */
tc.t_brkc = -1;
#ifdef LPASS8
diff --git a/misc.c b/misc.c
index 81105a3..75cf81a 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
-/* $XTermId: misc.c,v 1.742 2016/09/08 23:39:58 Joe.Peterson Exp $ */
+/* $XTermId: misc.c,v 1.743 2016/10/07 00:41:14 tom Exp $ */
/*
* Copyright 1999-2015,2016 by Thomas E. Dickey
@@ -2766,7 +2766,7 @@ ResetAnsiColorRequest(XtermWidget xw, char *buf, int start)
char *next;
color = (int) (strtol) (buf, &next, 10);
- if ((next == buf) || (color < 0))
+ if (!PartS2L(buf, next) || (color < 0))
break; /* no number at all */
if (next != 0) {
if (strchr(";", *next) == 0)
@@ -3666,7 +3666,7 @@ do_osc(XtermWidget xw, Char *oscbuf, size_t len, int final)
++buf;
} else {
which = strtol(buf, &next, 10);
- if (next == 0)
+ if (!PartS2L(buf, next) || (which < 0))
break;
buf = next;
if (*buf == ';')
@@ -3676,7 +3676,7 @@ do_osc(XtermWidget xw, Char *oscbuf, size_t len, int final)
++buf;
} else {
value = strtol(buf, &next, 10);
- if (next == 0)
+ if (!PartS2L(buf, next) || (which < 0))
break;
buf = next;
if (*buf == ';')
diff --git a/package/debian/changelog b/package/debian/changelog
index df450a5..e97dbbe 100644
--- a/package/debian/changelog
+++ b/package/debian/changelog
@@ -1,3 +1,9 @@
+xterm-dev (327) unstable; urgency=low
+
+ * maintenance updates
+
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 02 Oct 2016 19:18:09 -0400
+
xterm-dev (326) unstable; urgency=low
* maintenance updates
diff --git a/package/freebsd/Makefile b/package/freebsd/Makefile
index 5e1b471..dea332f 100644
--- a/package/freebsd/Makefile
+++ b/package/freebsd/Makefile
@@ -5,7 +5,7 @@
# and "make makesum".
PORTNAME= xterm
-PORTVERSION= 326
+PORTVERSION= 327
CATEGORIES= x11
MASTER_SITES= ftp://invisible-island.net/xterm/ \
CRITICAL
diff --git a/package/xterm.spec b/package/xterm.spec
index 0b35106..7ad34d1 100644
Reply to: