MANIFEST | 3 THANKS | 155 +++++++++++++++++++++++++ Tekproc.c | 6 button.c | 4 charproc.c | 42 ++++-- data.c | 6 data.h | 6 fontutils.c | 43 +++++-- input.c | 26 ++-- main.c | 77 +++++++----- main.h | 7 - menu.c | 4 menu.h | 4 misc.c | 48 ++++--- print.c | 8 - ptyx.h | 16 +- resize.c | 40 +++--- scrollback.c | 10 - scrollbar.c | 4 trace.c | 6 trace.h | 4 util.c | 26 +--- version.h | 4 vttests/256colors2.pl | 22 ++- vttests/88colors2.pl | 22 ++- xstrings.c | 10 - xstrings.h | 8 - xterm.h | 15 +- xterm.log.html | 306 ++++++++++++++++++++++++++++---------------------- xterm.man | 15 ++ xtermcap.c | 11 - 31 files changed, 634 insertions(+), 324 deletions(-)
New commits: commit e8ec13cdcea0f687aa64c747a8ad790628d16fff Author: Julien Cristau <jcris...@debian.org> Date: Tue Oct 13 13:28:58 2009 +0200 Import xterm 250 diff --git a/MANIFEST b/MANIFEST index 83163f5..7db856e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,4 +1,4 @@ -MANIFEST for xterm-249, version xterm-249 +MANIFEST for xterm-250, version xterm-250 -------------------------------------------------------------------------------- MANIFEST this file 256colres.h resource-definitions for 256-color mode @@ -13,6 +13,7 @@ Makefile.in configure script template for Makefile README overview & caveats for 'xterm' README.i18n i18n readme: README.os390 overview for os390 (EBCDIC) port of 'xterm' +THANKS list of direct contributors TekPrsTbl.c Tek4014 parser state tables Tekparse.def template for generating Tekparse.h Tekparse.h Tek4014 parser-state definitions diff --git a/THANKS b/THANKS new file mode 100644 index 0000000..ae3dbfc --- /dev/null +++ b/THANKS @@ -0,0 +1,155 @@ +-- $XTermId: THANKS,v 1.1 2009/10/11 17:30:42 tom Exp $ +-- vile:txtmode fk=8bit +There's no AUTHORS file in this distribution; it would be redundant since +I (Thomas E. Dickey) have done more than 80% of the work on xterm since 1996. + +There's no reliable history before that point. +For some insight, see + + http://invisible-island.net/xterm/xterm.faq.html#who_did_it + +Here's a list from xterm.log.html of people who have contributed changes. + +Adam Sulmicki +Alan Coopersmith +Alex Hornung +Alexander Pohoyda +Alexander V Lukyanov +Andrea Odetti +Andreas Jaeger +Andrew Sumner +Andrew Tipton +Anton Kovalenko +Ben Yoshino +Bernhard R Link +Bernhard Rosenkraenzer +Bill Nottingham +Bob Maynard +Bradd W Szonye +Bram Moolenaar +Branden Robinson +Bruno Haible +Caetano Jimenez Carezzato +Christian Biere +Christian Weisgerber +Chuck Blake +D Roland Walker +Daniel Colascione +Daniel Jacobowitz +David Dawes +David Krause +David Madore +David Mart�nez Moreno +David Mathog +David Wood +David Yeo +Denis Zaitsev +Dennis Schneider +Dr Werner Fink +Ed Schouten +Eddy De Greef +Edward S Arthur +Egbert Eich +Emanuele Giaquinta +Eugene Konev +Fabrice Bellard +Frank Giessler +Frank Guangxin Liu +Frank Liu +Gael Roualland +George Peter Staplin +Greg Badros +Greg Klanderman +Greg Smith +H Merijn Brand +Hasso Tepper +Holger Veit +Ilya Zakharevich +James Armstrong +Jason Bacon +Jason Vas Dias +Jeff Chua +Jeff Uphoff +Jens Schweikhardt +Jeremy Buhler +Jeroen Ruigrok +Jess Thrysoee +Jim Paris +Joe Allen +Joe Peterson +Johnny Billquist +Julien Cristau +Juliusz Chroboczek +Jungshik Shin +J�rgen Keil +Kean Johnston +Keith Packard +Ken Martin +Kevin Buhr +Kiyokazu Suto +Larry Riedel +Lee Olsen +Marc Bevand +Marc La France +Marius Tolzmann +Mark Waggoner +Markus Kuhn +Martin Pirker +Matthias Baake +Matthias Scheler +Matthieu Herrb +Matthieu Lagouge +Max Mikhanosha +Michael Rohleder +Michael Schroeder +Mike Castle +Mike Fabian +Mike Hopkirk +Min Sik Kim +Miroslav Lichvar +Nam SungHyun +Nelson Beebe +N�meth M�rton +Ovidiu Gheorghioiu +Paul Gilmartin +Paul Giordano +Paul Lampert +Paul Vojta +Paul Williams +Pavel Roskin +Per Hedeland +Peter Berg Larsen +Pierre Lombard +Richard Braakman +Richard Griswold +Rob Braun +Robert Brady +Robert Earl +Robin Cutshaw +Ross Paterson +Scott Sewall +Semen A Ustimenko +Sergei Laskavy +Sergey Vlasov +Slava Semushin +Stefan Dirsch +Steve Wall +Stuart Lissaman +Sven Verdoolaege +Taneli Huuskonen +Ted Phelps +Thomas Wolff +Tim Adye +Tim Pope +Tobias Stoeckmann +Todd Larason +Todd Miller +Tomas Vanhala +Tomasz Cholewo +Tomohiro Kubota +Tor Lillqvist +Torrey Lyons +Victor Stinner +Werner Lemberg +Will Day +Zdenek Sekera diff --git a/Tekproc.c b/Tekproc.c index 478393c..cb3f6b2 100644 --- a/Tekproc.c +++ b/Tekproc.c @@ -1,4 +1,4 @@ -/* $XTermId: Tekproc.c,v 1.172 2009/08/09 17:22:34 tom Exp $ */ +/* $XTermId: Tekproc.c,v 1.173 2009/10/12 00:31:59 tom Exp $ */ /* * Warning, there be crufty dragons here. @@ -1887,10 +1887,10 @@ TekCopy(TekWidget tw) sprintf(initbuf, "%c%c%c%c", ANSI_ESC, (char) (tekscr->page.fontsize + '8'), ANSI_ESC, (char) (tekscr->page.linetype + '`')); - write(tekcopyfd, initbuf, (size_t) 4); + IGNORE_RC(write(tekcopyfd, initbuf, (size_t) 4)); Tp = &Tek0; do { - write(tekcopyfd, Tp->data, (size_t) Tp->count); + IGNORE_RC(write(tekcopyfd, Tp->data, (size_t) Tp->count)); Tp = Tp->next; } while (Tp); close(tekcopyfd); diff --git a/button.c b/button.c index 877b209..6ccd5d5 100644 --- a/button.c +++ b/button.c @@ -1,4 +1,4 @@ -/* $XTermId: button.c,v 1.355 2009/10/01 09:06:20 tom Exp $ */ +/* $XTermId: button.c,v 1.356 2009/10/10 23:37:27 tom Exp $ */ /* * Copyright 1999-2008,2009 by Thomas E. Dickey @@ -2626,7 +2626,7 @@ okPosition(TScreen * screen, { Boolean result = True; - if (cell->row >= screen->max_row) { + if (cell->row > screen->max_row) { result = False; } else if (cell->col > (LastTextCol(screen, *ld, cell->row) + 1)) { cell->col = 0; diff --git a/charproc.c b/charproc.c index 6e7b7b6..c65f55c 100644 --- a/charproc.c +++ b/charproc.c @@ -1,4 +1,4 @@ -/* $XTermId: charproc.c,v 1.974 2009/09/27 22:37:54 tom Exp $ */ +/* $XTermId: charproc.c,v 1.980 2009/10/11 23:48:30 tom Exp $ */ /* @@ -116,6 +116,7 @@ in this Software without prior written authorization from The Open Group. #include <stdio.h> #include <ctype.h> +#include <assert.h> #if defined(HAVE_SCHED_YIELD) #include <sched.h> @@ -393,7 +394,7 @@ static XtActionsRec actionsList[] = { }; /* *INDENT-ON* */ -static XtResource resources[] = +static XtResource xterm_resources[] = { Bres(XtNallowSendEvents, XtCAllowSendEvents, screen.allowSendEvent0, False), Bres(XtNallowFontOps, XtCAllowFontOps, screen.allowFontOp0, DEF_ALLOW_FONT), @@ -741,8 +742,8 @@ static WidgetClassRec xtermClassRec = { { -/* core_class fields */ - (WidgetClass) & widgetClassRec, /* superclass */ + /* core_class fields */ + (WidgetClass) & widgetClassRec, /* superclass */ "VT100", /* class_name */ sizeof(XtermWidgetRec), /* widget_size */ VTClassInit, /* class_initialize */ @@ -753,8 +754,8 @@ WidgetClassRec xtermClassRec = VTRealize, /* realize */ actionsList, /* actions */ XtNumber(actionsList), /* num_actions */ - resources, /* resources */ - XtNumber(resources), /* num_resources */ + xterm_resources, /* resources */ + XtNumber(xterm_resources), /* num_resources */ NULLQUARK, /* xrm_class */ True, /* compress_motion */ False, /* compress_exposure */ @@ -1151,10 +1152,10 @@ set_mod_fkeys(XtermWidget xw, int which, int what, Bool enabled) #if OPT_TRACE #define WHICH_TABLE(name) if (table == name) result = #name -static char * +static const char * which_table(Const PARSE_T * table) { - char *result = "?"; + const char *result = "?"; /* *INDENT-OFF* */ WHICH_TABLE (ansi_table); else WHICH_TABLE (cigtable); @@ -4766,7 +4767,7 @@ unparseputn(XtermWidget xw, unsigned int n) } void -unparseputs(XtermWidget xw, char *s) +unparseputs(XtermWidget xw, const char *s) { while (*s) unparseputc(xw, *s++); @@ -5375,7 +5376,7 @@ ParseOnClicks(XtermWidget wnew, XtermWidget wreq, Cardinal item) { /* *INDENT-OFF* */ static struct { - const String name; + const char * name; SelectUnit code; } table[] = { { "char", Select_CHAR }, @@ -5432,7 +5433,7 @@ VTInitialize(Widget wrequest, Bool color_ok; #endif -#if OPT_COLOR_RES2 && (MAXCOLORS > MIN_ANSI_COLORS) +#if OPT_COLOR_RES2 static XtResource fake_resources[] = { #if OPT_256_COLORS @@ -5443,7 +5444,8 @@ VTInitialize(Widget wrequest, }; #endif /* OPT_COLOR_RES2 */ - TRACE(("VTInitialize\n")); + TRACE(("VTInitialize %d / %d\n", XtNumber(xterm_resources), MAXRESOURCES)); + assert(XtNumber(xterm_resources) < MAXRESOURCES); /* Zero out the entire "screen" component of "wnew" widget, then do * field-by-field assignment of "screen" fields that are named in the @@ -5717,9 +5719,14 @@ VTInitialize(Widget wrequest, init_Bres(screen.italicULMode); init_Bres(screen.colorRVMode); +#if OPT_COLOR_RES2 + TRACE(("...will fake resources for color%d to color%d\n", + MIN_ANSI_COLORS, + NUM_ANSI_COLORS - 1)); +#endif for (i = 0, color_ok = False; i < MAXCOLORS; i++) { -#if OPT_COLOR_RES2 && (MAXCOLORS > MIN_ANSI_COLORS) +#if OPT_COLOR_RES2 /* * Xt has a hardcoded limit on the maximum number of resources that can * be used in a widget. If we configure both luit (which implies @@ -6264,14 +6271,15 @@ VTRealize(Widget w, False, screen->menu_font_number)) { if (XmuCompareISOLatin1(myfont->f_n, DEFFONT) != 0) { + char *use_font = x_strdup(DEFFONT); fprintf(stderr, "%s: unable to open font \"%s\", trying \"%s\"....\n", - xterm_name, myfont->f_n, DEFFONT); + xterm_name, myfont->f_n, use_font); (void) xtermLoadFont(xw, - xtermFontName(DEFFONT), + xtermFontName(use_font), False, screen->menu_font_number); - screen->MenuFontName(screen->menu_font_number) = DEFFONT; + screen->MenuFontName(screen->menu_font_number) = use_font; } } @@ -6584,7 +6592,7 @@ xim_real_init(XtermWidget xw) XIMStyle input_style = 0; Bool found; static struct { - char *name; + const char *name; unsigned long code; } known_style[] = { { diff --git a/data.c b/data.c index 795e753..7840f8b 100644 --- a/data.c +++ b/data.c @@ -1,4 +1,4 @@ -/* $XTermId: data.c,v 1.90 2009/08/09 17:22:56 tom Exp $ */ +/* $XTermId: data.c,v 1.91 2009/10/12 00:33:20 tom Exp $ */ /* * Copyright 2002-2006,2007 by Thomas E. Dickey @@ -110,3 +110,7 @@ int mapstate = -1; #if OPT_SESSION_MGT int ice_fd = -1; #endif + +#ifdef USE_IGNORE_RC +int ignore_unused; +#endif diff --git a/data.h b/data.h index 41f152a..edeefe8 100644 --- a/data.h +++ b/data.h @@ -1,4 +1,4 @@ -/* $XTermId: data.h,v 1.109 2009/08/09 17:23:01 tom Exp $ */ +/* $XTermId: data.h,v 1.110 2009/10/12 00:33:08 tom Exp $ */ /* * Copyright 2002-2007,2009 by Thomas E. Dickey @@ -211,4 +211,8 @@ typedef struct XTERM_RESOURCE { extern XTERM_RESOURCE resource; +#ifdef USE_IGNORE_RC +extern int ignore_unused; +#endif + #endif /* included_data_h */ diff --git a/fontutils.c b/fontutils.c index 904b56c..ed1cf71 100644 --- a/fontutils.c +++ b/fontutils.c @@ -1,4 +1,4 @@ -/* $XTermId: fontutils.c,v 1.314 2009/09/30 09:37:45 tom Exp $ */ +/* $XTermId: fontutils.c,v 1.319 2009/10/12 22:29:42 tom Exp $ */ /************************************************************ @@ -373,7 +373,7 @@ alloca_fontname(char **result, size_t next) } static void -append_fontname_str(char **result, char *value) +append_fontname_str(char **result, const char *value) { if (value == 0) value = "*"; @@ -405,9 +405,9 @@ append_fontname_num(char **result, int value) */ static char * derive_font_name(FontNameProperties * props, - char *use_weight, + const char *use_weight, int use_average_width, - char *use_encoding) + const char *use_encoding) { char *result = 0; @@ -467,7 +467,7 @@ xtermSpecialFont(TScreen * screen, unsigned atts, unsigned chrset) #endif FontNameProperties *props; char *result = 0; - char *weight; + const char *weight; int pixel_size; int res_x; int res_y; @@ -1241,7 +1241,7 @@ typedef struct { * correspond to the VT100 resources. */ static Bool -xtermLoadVTFonts(XtermWidget xw, char *myName, char *myClass) +xtermLoadVTFonts(XtermWidget xw, String myName, String myClass) { static Bool initialized = False; static SubResourceRec original, referenceRec, subresourceRec; @@ -1328,7 +1328,7 @@ xtermLoadVTFonts(XtermWidget xw, char *myName, char *myClass) #if OPT_WIDE_CHARS static Bool -isWideFont(XFontStruct * fp, char *tag, Bool nullOk) +isWideFont(XFontStruct * fp, const char *tag, Bool nullOk) { Bool result = False; @@ -1564,15 +1564,23 @@ checkXft(XtermWidget xw, XTermXftFonts * data, XftFont * xft) data->map.min_width = 0; data->map.max_width = (Dimension) xft->max_advance_width; + /* + * For each ASCII or ISO-8859-1 printable code, ask what its width is. + * Given the maximum width for those, we have a reasonable estimate of + * the single-column width. + * + * Ignore control characters - their extent information is misleading. + */ for (c = 32; c < 256; ++c) { - if (c >= 128 && c < 159) + if (c >= 127 && c <= 159) continue; if (FcCharSetHasChar(xft->charset, c)) { XGlyphInfo extents; XftTextExtents32(XtDisplay(xw), xft, &c, 1, &extents); - if (width < extents.width) + if (width < extents.width && extents.width <= data->map.max_width) { width = extents.width; + } } } data->map.min_width = width; @@ -1694,6 +1702,15 @@ setRenderFontsize(TScreen * screen, VTwin * win, XftFont * font, const char *tag } #endif +static void +checkFontInfo(int value, const char *tag) +{ + if (value == 0) { + fprintf(stderr, "Selected font has no non-zero %s for ISO-8859-1 encoding\n", tag); + exit(1); + } +} + /* * Compute useful values for the font/window sizes */ @@ -1930,9 +1947,10 @@ xtermComputeFontInfo(XtermWidget xw, XTermXftFonts *use = &(screen->renderFontNorm[fontnum]); win->f_height = use->font->ascent + use->font->descent; win->f_width = use->map.min_width; - TRACE(("...packed TrueType font %dx%d\n", + TRACE(("...packed TrueType font %dx%d vs %d\n", win->f_height, - win->f_width)); + win->f_width, + use->map.max_width)); } #endif DUMP_XFT(xw, &(screen->renderFontNorm[fontnum])); @@ -1971,6 +1989,9 @@ xtermComputeFontInfo(XtermWidget xw, win->f_width, win->f_ascent, win->f_descent)); + + checkFontInfo(win->f_height, "height"); + checkFontInfo(win->f_width, "width"); } /* save this information as a side-effect for double-sized characters */ diff --git a/input.c b/input.c index fd6e3e0..9ee1fc5 100644 --- a/input.c +++ b/input.c @@ -1,4 +1,4 @@ -/* $XTermId: input.c,v 1.309 2009/06/18 00:08:40 tom Exp $ */ +/* $XTermId: input.c,v 1.310 2009/10/12 00:12:34 tom Exp $ */ /* * Copyright 1999-2008,2009 by Thomas E. Dickey @@ -125,13 +125,14 @@ typedef struct { char strbuf[STRBUFSIZE]; } KEY_DATA; -/* 0123456789 abc def0123456789abcdef0123456789abcdef0123456789abcd */ -static char *kypd_num = " XXXXXXXX\tXXX\rXXXxxxxXXXXXXXXXXXXXXXXXXXXX*+,-./0123456789XXX="; - -/* 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd */ -static char *kypd_apl = " ABCDEFGHIJKLMNOPQRSTUVWXYZ??????abcdefghijklmnopqrstuvwxyzXXX"; - -static char *curfinal = "HDACB FE"; +static +const char *kypd_num = " XXXXXXXX\tXXX\rXXXxxxxXXXXXXXXXXXXXXXXXXXXX*+,-./0123456789XXX="; +/* 0123456789 abc def0123456789abcdef0123456789abcdef0123456789abcd */ +static +const char *kypd_apl = " ABCDEFGHIJKLMNOPQRSTUVWXYZ??????abcdefghijklmnopqrstuvwxyzXXX"; +/* 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd */ +static +const char *curfinal = "HDACB FE"; static int decfuncvalue(KEY_DATA *); static void sunfuncvalue(ANSI *, KEY_DATA *); @@ -139,10 +140,10 @@ static void hpfuncvalue(ANSI *, KEY_DATA *); static void scofuncvalue(ANSI *, KEY_DATA *); #if OPT_TRACE -static char * +static const char * ModifierName(unsigned modifier) { - char *s = ""; + const char *s = ""; if (modifier & ShiftMask) s = " Shift"; else if (modifier & LockMask) @@ -1786,7 +1787,8 @@ TranslationsUseKeyword(Widget w, char **cache, const char *keyword) } free(test); } - TRACE(("TranslationsUseKeyword(%p, %s) = %d\n", w, keyword, result)); + TRACE(("TranslationsUseKeyword(%p, %s) = %d\n", + (void *) w, keyword, result)); return result; } @@ -1803,7 +1805,7 @@ xtermHasTranslation(XtermWidget xw, const char *keyword) #if OPT_EXTRA_PASTE static void -addTranslation(XtermWidget xw, char *fromString, char *toString) +addTranslation(XtermWidget xw, const char *fromString, const char *toString) { unsigned have = (xw->keyboard.extra_translations ? strlen(xw->keyboard.extra_translations) diff --git a/main.c b/main.c index 13ad09c..f3ee32b 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $XTermId: main.c,v 1.594 2009/08/30 21:40:45 Alex.Hornung Exp $ */ +/* $XTermId: main.c,v 1.597 2009/10/12 21:58:27 tom Exp $ */ /* * W A R N I N G @@ -448,11 +448,11 @@ extern char *ptsname(int); #endif #ifndef VMS -static SIGNAL_T reapchild(int n); +static SIGNAL_T reapchild(int /* n */ ); static int spawnXTerm(XtermWidget /* xw */ ); -static void remove_termcap_entry(char *buf, char *str); +static void remove_termcap_entry(char *, const char *); #ifdef USE_PTY_SEARCH -static int pty_search(int *pty); +static int pty_search(int * /* pty */ ); #endif #endif /* ! VMS */ @@ -640,7 +640,7 @@ static struct jtchars d_jtc = static Boolean override_tty_modes = False; /* *INDENT-OFF* */ static struct _xttymodes { - char *name; + const char *name; size_t len; int set; int value; @@ -1329,7 +1329,7 @@ decode_keyvalue(char **ptr, int termcap) } static int -abbrev(char *tst, char *cmp, size_t need) +abbrev(const char *tst, const char *cmp, size_t need) { size_t len = strlen(tst); return ((len >= need) && (!strncmp(tst, cmp, len))); @@ -2301,7 +2301,7 @@ main(int argc, char *argv[]ENVP_ARG) buf[0] = '\0'; sprintf(buf, "%lx\n", XtWindow(SHELL_OF(CURRENT_EMU()))); - write(screen->respond, buf, strlen(buf)); + IGNORE_RC(write(screen->respond, buf, strlen(buf))); } #ifdef AIXV3 #if (OSMAJORVERSION < 4) @@ -2711,7 +2711,7 @@ pty_search(int *pty) */ #if OPT_TEK4014 -static char *tekterm[] = +static const char *tekterm[] = { "tek4014", "tek4015", /* 4014 with APL character set support */ @@ -2730,7 +2730,7 @@ static char *tekterm[] = * The VT420 has up to 48 lines on the screen. */ -static char *vtterm[] = +static const char *vtterm[] = { #ifdef USE_X11TERM "x11term", /* for people who want special term name */ @@ -2847,7 +2847,9 @@ HsSysError(int error) handshake.fatal_error, handshake.buffer)); TRACE_HANDSHAKE("writing", &handshake); - write(cp_pipe[1], (char *) &handshake, sizeof(handshake)); + IGNORE_RC(write(cp_pipe[1], + (const char *) &handshake, + sizeof(handshake))); } else { fprintf(stderr, "%s: fatal pty error errno=%d, error=%d device \"%s\"\n", @@ -2876,7 +2878,9 @@ first_map_occurred(void) if (pc_pipe[1] >= 0) { TRACE(("first_map_occurred: %dx%d\n", handshake.rows, handshake.cols)); TRACE_HANDSHAKE("writing", &handshake); - write(pc_pipe[1], (char *) &handshake, sizeof(handshake)); + IGNORE_RC(write(pc_pipe[1], + (const char *) &handshake, + sizeof(handshake))); close(cp_pipe[0]); close(pc_pipe[1]); } @@ -3035,7 +3039,7 @@ spawnXTerm(XtermWidget xw) char *ptr, *shname, *shname_minus; int i, no_dev_tty = False; - char **envnew; /* new environment */ + const char **envnew; /* new environment */ char buf[64]; char *TermName = NULL; #ifdef TTYSIZE_STRUCT @@ -3275,15 +3279,22 @@ spawnXTerm(XtermWidget xw) */ ok_termcap = True; if (!get_termcap(TermName = resource.term_name, newtc)) { - char *last = NULL; - TermName = *envnew; + const char *last = NULL; + char *next; + + TermName = x_strdup(*envnew); ok_termcap = False; while (*envnew != NULL) { - if ((last == NULL || strcmp(last, *envnew)) - && get_termcap(*envnew, newtc)) { - TermName = *envnew; - ok_termcap = True; - break; + if (last == NULL || strcmp(last, *envnew)) { + next = x_strdup(*envnew); + if (get_termcap(next, newtc)) { + free(TermName); + TermName = next; + ok_termcap = True; + break; + } else { + free(next); + } } last = *envnew; envnew++; @@ -3307,8 +3318,9 @@ spawnXTerm(XtermWidget xw) } else if (resource.ptyInitialErase) { ; } else if (ok_termcap) { + static char name[] = TERMCAP_ERASE; char temp[1024], *p = temp; - char *s = tgetstr(TERMCAP_ERASE, &p); + char *s = tgetstr(name, &p); TRACE(("...extracting initial_erase value from termcap\n")); if (s != 0) { initial_erase = decode_keyvalue(&s, True); @@ -3562,8 +3574,9 @@ spawnXTerm(XtermWidget xw) handshake.error = errno; strcpy(handshake.buffer, ttydev); TRACE_HANDSHAKE("writing", &handshake); - write(cp_pipe[1], (char *) &handshake, - sizeof(handshake)); + IGNORE_RC(write(cp_pipe[1], + (const char *) &handshake, + sizeof(handshake))); /* get reply from parent */ i = read(pc_pipe[0], (char *) &handshake, @@ -3909,7 +3922,7 @@ spawnXTerm(XtermWidget xw) for (i = 0; i <= 2; i++) if (i != ttyfd) { (void) close(i); - (void) dup(ttyfd); + IGNORE_RC(dup(ttyfd)); } #ifndef ATT /* and close the tty */ @@ -4218,7 +4231,9 @@ spawnXTerm(XtermWidget xw) handshake.error = 0; (void) strcpy(handshake.buffer, ttydev); TRACE_HANDSHAKE("writing", &handshake); - (void) write(cp_pipe[1], (char *) &handshake, sizeof(handshake)); + IGNORE_RC(write(cp_pipe[1], + (const char *) &handshake, + sizeof(handshake))); if (resource.wait_for_map) { i = read(pc_pipe[0], (char *) &handshake, @@ -4322,7 +4337,7 @@ spawnXTerm(XtermWidget xw) if (((ptr = x_getenv("SHELL")) == NULL) && ((pw == NULL && (pw = getpwuid(screen->uid)) == NULL) || *(ptr = pw->pw_shell) == 0)) { - ptr = "/bin/sh"; + ptr = x_strdup("/bin/sh"); } } else { xtermSetenv("SHELL", explicit_shname); @@ -4385,7 +4400,7 @@ spawnXTerm(XtermWidget xw) if (xw->misc.login_shell) { int u; u = (term->misc.use_encoding ? 2 : 0); - command_to_exec_with_luit[u + 1] = "-argv0"; + command_to_exec_with_luit[u + 1] = x_strdup("-argv0"); command_to_exec_with_luit[u + 2] = shname_minus; command_to_exec_with_luit[u + 3] = NULL; } @@ -4448,13 +4463,17 @@ spawnXTerm(XtermWidget xw) ProgramName, strerror(errno)); handshake.status = PTY_NOMORE; TRACE_HANDSHAKE("writing", &handshake); - write(pc_pipe[1], (char *) &handshake, sizeof(handshake)); + IGNORE_RC(write(pc_pipe[1], + (const char *) &handshake, + sizeof(handshake))); exit(ERROR_PTYS); } handshake.status = PTY_NEW; (void) strcpy(handshake.buffer, ttydev); TRACE_HANDSHAKE("writing", &handshake); - write(pc_pipe[1], (char *) &handshake, sizeof(handshake)); + IGNORE_RC(write(pc_pipe[1], + (const char *) &handshake, + sizeof(handshake))); break; case PTY_FATALERROR: @@ -4836,7 +4855,7 @@ reapchild(int n GCC_UNUSED) #endif /* !VMS */ static void -remove_termcap_entry(char *buf, char *str) +remove_termcap_entry(char *buf, const char *str) { char *base = buf; char *first = base; diff --git a/main.h b/main.h index 8e18d4c..5c4caa6 100644 --- a/main.h +++ b/main.h @@ -1,4 +1,4 @@ -/* $XTermId: main.h,v 1.43 2009/10/02 00:02:26 tom Exp $ */ +/* $XTermId: main.h,v 1.44 2009/10/10 09:38:25 tom Exp $ */ /* * Copyright 2000-2008,2009 by Thomas E. Dickey @@ -169,4 +169,9 @@ #define DEFLOCALEFILTER DEFLOCALEFILTER1(PROJECTROOT) "/bin/luit" #endif +/* + * See lib/Xt/Resources.c + */ +#define MAXRESOURCES 400 + #endif /* included_main_h */ diff --git a/menu.c b/menu.c index 79377b3..a40d2ea 100644 --- a/menu.c +++ b/menu.c @@ -1,4 +1,4 @@ -/* $XTermId: menu.c,v 1.253 2009/09/27 22:36:07 tom Exp $ */ +/* $XTermId: menu.c,v 1.254 2009/10/11 22:46:44 tom Exp $ */ /* @@ -1849,7 +1849,7 @@ HandleSendSignal(Widget w, { /* *INDENT-OFF* */ static struct sigtab { - char *name; + const char *name; int sig; } signals[] = { #ifdef SIGTSTP diff --git a/menu.h b/menu.h index 20295fb..4cf4890 100644 --- a/menu.h +++ b/menu.h @@ -1,4 +1,4 @@ -/* $XTermId: menu.h,v 1.116 2009/09/27 22:33:36 tom Exp $ */ +/* $XTermId: menu.h,v 1.117 2009/10/11 22:45:22 tom Exp $ */ /* @@ -56,7 +56,7 @@ from The Open Group. #include <xterm.h> typedef struct _MenuEntry { - char *name; + const char *name; void (*function) PROTO_XT_CALLBACK_ARGS; Widget widget; } MenuEntry; diff --git a/misc.c b/misc.c index b84e78e..d378f90 100644 --- a/misc.c +++ b/misc.c @@ -1,4 +1,4 @@ -/* $XTermId: misc.c,v 1.425 2009/08/07 23:18:31 tom Exp $ */ +/* $XTermId: misc.c,v 1.428 2009/10/12 00:44:44 tom Exp $ */ /* * @@ -516,7 +516,7 @@ HandleKeyPressed(Widget w GCC_UNUSED, String * params GCC_UNUSED, Cardinal *nparams GCC_UNUSED) { - TRACE(("Handle insert-seven-bit for %p\n", w)); + TRACE(("Handle insert-seven-bit for %p\n", (void *) w)); #ifdef ACTIVEWINDOWINPUTONLY if (w == CURRENT_EMU()) #endif @@ -530,7 +530,7 @@ HandleEightBitKeyPressed(Widget w GCC_UNUSED, String * params GCC_UNUSED, Cardinal *nparams GCC_UNUSED) { - TRACE(("Handle insert-eight-bit for %p\n", w)); + TRACE(("Handle insert-eight-bit for %p\n", (void *) w)); #ifdef ACTIVEWINDOWINPUTONLY if (w == CURRENT_EMU()) #endif @@ -634,7 +634,7 @@ HandleSpawnTerminal(Widget w GCC_UNUSED, } else if (!pid) { /* We are the child */ if (child_cwd) { - chdir(child_cwd); /* We don't care if this fails */ + IGNORE_RC(chdir(child_cwd)); /* We don't care if this fails */ } if (setuid(screen->uid) == -1 @@ -1139,7 +1139,7 @@ HandleDabbrevExpand(Widget w, { XtermWidget xw; - TRACE(("Handle dabbrev-expand for %p\n", w)); + TRACE(("Handle dabbrev-expand for %p\n", (void *) w)); if ((xw = getXtermWidget(w)) != 0) { TScreen *screen = &xw->screen; if (!dabbrev_expand(screen)) @@ -1667,7 +1667,8 @@ StartLog(TScreen * screen) && ((pw = getpwuid(screen->uid)) == NULL || *(cp = pw->pw_shell) == 0)) || (shell = CastMallocN(char, strlen(cp))) == 0) { - shell = "/bin/sh"; + static char dummy[] = "/bin/sh"; + shell = dummy; } else { strcpy(shell, cp); } @@ -1733,7 +1734,7 @@ FlushLog(TScreen * screen) cp = VTbuffer->next; if (screen->logstart != 0 && (i = cp - screen->logstart) > 0) { - write(screen->logfd, (char *) screen->logstart, (unsigned) i); + IGNORE_RC(write(screen->logfd, screen->logstart, (unsigned) i)); } screen->logstart = VTbuffer->next; } @@ -2030,7 +2031,7 @@ ManipulateSelectionData(XtermWidget xw, TScreen * screen, char *buf, int final) PDATA('7', CUT_BUFFER7), }; - char *base = buf; + const char *base = buf; char *used = x_strdup(base); Cardinal j, n = 0; char **select_args = 0; @@ -3014,7 +3015,7 @@ udk_lookup(int keycode, int *len) } static void -ChangeGroup(XtermWidget xw, String attribute, char *value) +ChangeGroup(XtermWidget xw, const char *attribute, char *value) { #if OPT_WIDE_CHARS static Char *converted; /* NO_LEAKS */ @@ -3022,6 +3023,7 @@ ChangeGroup(XtermWidget xw, String attribute, char *value) static char empty[1]; Arg args[1]; + char *my_attr = x_strdup(attribute); char *original = (value != 0) ? value : empty; char *name = original; TScreen *screen = TScreenOf(xw); @@ -3031,7 +3033,7 @@ ChangeGroup(XtermWidget xw, String attribute, char *value) Char *c1 = (Char *) original; -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org