xterm-132.patch.txt

# ------------------------------------------------------------------------------
# MANIFEST       |    2 
# aclocal.m4     |   75 ++++++++--
# charproc.c     |  409 ++++++++++++++-----------------------------------------
# config.guess   |    5 
# config.sub     |   11 +
# configure      |  404 +++++++++++++++++++++++++++++++-----------------------
# ctlseqs.ms     |    2 
# input.c        |    2 
# main.c         |   91 +++++++-----
# mkdirs.sh      |    6 
# ptyx.h         |    3 
# resize.c       |   31 ++--
# scrollbar.c    |    2 
# version.h      |    4 
# xterm.h        |   11 +
# xterm.log.html |   33 ++++
# xterm.man      |   12 +
# xtermcfg.hin   |    3 
# 18 files changed, 564 insertions, 542 deletions
# ------------------------------------------------------------------------------
Index: MANIFEST
--- xterm-131+/MANIFEST Fri Apr  7 02:44:10 2000
+++ xterm-132/MANIFEST  Mon Apr 10 22:22:20 2000
@@ -1,4 +1,4 @@
-MANIFEST for xterm-131, version xterm-131
+MANIFEST for xterm-132, version xterm-132
 --------------------------------------------------------------------------------
 MANIFEST                        this file
 256colres.h                     resource-definitions for 256-color mode
Index: aclocal.m4
--- xterm-131+/aclocal.m4       Sat Mar  4 04:36:01 2000
+++ xterm-132/aclocal.m4        Tue Apr 11 19:44:44 2000
@@ -2,11 +2,11 @@
 dnl $XFree86: xc/programs/xterm/aclocal.m4,v 3.30 2000/03/03 20:02:28 dawes Exp $
 dnl
 dnl ---------------------------------------------------------------------------
-dnl 
+dnl
 dnl Copyright 1997-2000 by Thomas E. Dickey <dickey@clark.net>
-dnl 
+dnl
 dnl                         All Rights Reserved
-dnl 
+dnl
 dnl Permission to use, copy, modify, and distribute this software and its
 dnl documentation for any purpose and without fee is hereby granted,
 dnl provided that the above copyright notice appear in all copies and that
@@ -15,7 +15,7 @@
 dnl copyright holder(s) not be used in advertising or publicity pertaining
 dnl to distribution of the software without specific, written prior
 dnl permission.
-dnl 
+dnl
 dnl THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
 dnl TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 dnl AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
@@ -23,7 +23,7 @@
 dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-dnl 
+dnl
 dnl ---------------------------------------------------------------------------
 dnl ---------------------------------------------------------------------------
 dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
@@ -740,16 +740,73 @@
 dnl setting pty ownership.
 AC_DEFUN([CF_TTY_GROUP],
 [
-AC_CACHE_CHECK(for tty group,cf_cv_tty_group,[
+AC_CACHE_CHECK(for tty group name,cf_cv_tty_group_name,[
+
+# If we are configuring as root, it is hard to get a clue about the tty group.
+# But we'll guess based on how our connection is set up - assuming it is done
+# properly.
+
+cf_uid=`id | sed -e 's/^[^=]*=//' -e 's/(.*$//'`
+if test "$cf_uid" != 0 ; then
+cf_cv_tty_group_name=
+cf_tty_name=`tty`
+test -z "$cf_tty_name" && cf_tty_name=/dev/tty
+if test -c $cf_tty_name
+then
+       cf_option="-l -L"
+
+       # Expect listing to have fields like this:
+       #-rwxrwxrwx   1 user      group       34293 Jul 18 16:29 pathname
+       ls $cf_option $cf_tty_name >conftest.out
+       read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest <conftest.out
+       if test -z "$cf_rest" ; then
+               cf_option="$cf_option -g"
+               ls $cf_option $cf_tty_name >conftest.out
+               read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest <conftest.out
+       fi
+       rm -f conftest.out
+       cf_cv_tty_group_name=$cf_grp
+fi
+fi
+
+# If we cannot deduce the tty group, fall back on hardcoded cases
+
+if test -z "$cf_cv_tty_group_name"
+then
+case $host_os in #(vi
+osf*) #(vi
+       cf_cv_tty_group_name="terminal"
+       ;;
+*)
+       cf_cv_tty_group_name="tty"
+       ;;
+esac
+fi
+])
+
+AC_DEFINE_UNQUOTED(TTY_GROUP_NAME,"$cf_cv_tty_group_name")
+
+AC_CACHE_CHECK(if we may use tty group,cf_cv_tty_group,[
 AC_TRY_RUN([
+#include <unistd.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <grp.h>
 int main()
 {
-       struct group *ttygrp;
-       int code = (ttygrp = getgrnam("tty")) == 0;
+       struct stat sb;
+       struct group *ttygrp = getgrnam(TTY_GROUP_NAME);
+       char *name = ttyname(0);
+
        endgrent();
-       exit(code);
+       if (ttygrp != 0
+        && name != 0
+        && stat(name, &sb) == 0
+        && sb.st_gid != getgid()
+        && sb.st_gid == ttygrp->gr_gid) {
+               exit(0);
+       }
+       exit(1);
 }
        ],
        [cf_cv_tty_group=yes],
Index: charproc.c
--- xterm-131+/charproc.c       Fri Apr  7 02:44:10 2000
+++ xterm-132/charproc.c        Mon Apr 10 22:05:36 2000
@@ -188,7 +188,6 @@
 
 /* Defaults */
 #if OPT_ISO_COLORS
-static  Boolean        defaultCOLORMODE   = DFT_COLORMODE;
 
 /*
  * If we default to colorMode enabled, compile-in defaults for the ANSI colors.
@@ -200,30 +199,8 @@
 #endif
 #endif
 
-static  Boolean        defaultFALSE       = FALSE;
-static  Boolean        defaultTRUE        = TRUE;
-static  int    defaultZERO        = 0;
-static  int    defaultIntBorder   = DEFBORDER;
-static  int    defaultSaveLines   = SAVELINES;
-static int     defaultScrollLines = SCROLLLINES;
-static  int    defaultNMarginBell = N_MARGINBELL;
-static  int    defaultMultiClickTime = MULTICLICKTIME;
-static  int    defaultBellSuppressTime = BELLSUPPRESSMSEC;
 static char *  _Font_Selected_ = "yes";  /* string is arbitrary */
 
-#if OPT_BLINK_CURS
-static  int    defaultBlinkOnTime = 600;
-static  int    defaultBlinkOffTime = 300;
-#endif
-
-#if OPT_PRINT_COLORS
-static  int    defaultONE = 1;
-#endif
-
-#if OPT_DEC_CHRSET
-static int     default_NUM_CHRSET = NUM_CHRSET;
-#endif
-
 static char defaultTranslations[] =
 "\
           Shift <KeyPress> Prior:scroll-back(1,halfpage) \n\
@@ -368,129 +345,55 @@
 };
 
 static XtResource resources[] = {
-{XtNfont, XtCFont, XtRString, sizeof(char *),
-       XtOffsetOf(XtermWidgetRec, misc.f_n), XtRString,
-       DEFFONT},
-{XtNboldFont, XtCBoldFont, XtRString, sizeof(char *),
-       XtOffsetOf(XtermWidgetRec, misc.f_b), XtRString,
-       DEFBOLDFONT},
-{XtNc132, XtCC132, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.c132),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNcharClass, XtCCharClass, XtRString, sizeof(char *),
-       XtOffsetOf(XtermWidgetRec, screen.charClass),
-       XtRString, (XtPointer) NULL},
-{XtNcurses, XtCCurses, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.curses),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNhpLowerleftBugCompat, XtCHpLowerleftBugCompat, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.hp_ll_bc),
-       XtRBoolean, (XtPointer) &defaultFALSE},
+Sres(XtNfont,          XtCFont,        misc.f_n,               DEFFONT),
+Sres(XtNboldFont,      XtCBoldFont,    misc.f_b,               DEFBOLDFONT),
+Bres(XtNc132,          XtCC132,        screen.c132,            FALSE),
+Sres(XtNcharClass,     XtCCharClass,   screen.charClass,       NULL),
+Bres(XtNcurses,                XtCCurses,      screen.curses,          FALSE),
+Bres(XtNhpLowerleftBugCompat, XtCHpLowerleftBugCompat, screen.hp_ll_bc, FALSE),
 #if OPT_XMC_GLITCH
-{XtNxmcGlitch, XtCXmcGlitch, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.xmc_glitch),
-       XtRString, "0"},
-{XtNxmcAttributes, XtCXmcAttributes, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.xmc_attributes),
-       XtRString, "1"},
-{XtNxmcInline, XtCXmcInline, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.xmc_inline),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNxmcMoveSGR, XtCXmcMoveSGR, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.move_sgr_ok),
-       XtRBoolean, (XtPointer) &defaultTRUE},
-#endif
-{XtNcutNewline, XtCCutNewline, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.cutNewline),
-       XtRBoolean, (XtPointer) &defaultTRUE},
-{XtNcutToBeginningOfLine, XtCCutToBeginningOfLine, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.cutToBeginningOfLine),
-       XtRBoolean, (XtPointer) &defaultTRUE},
-{XtNhighlightSelection,XtCHighlightSelection,XtRBoolean,
-       sizeof(Boolean),XtOffsetOf(XtermWidgetRec, screen.highlight_selection),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNtrimSelection,XtCTrimSelection,XtRBoolean,
-       sizeof(Boolean),XtOffsetOf(XtermWidgetRec, screen.trim_selection),
-       XtRBoolean, (XtPointer) &defaultFALSE},
+Ires(XtNxmcGlitch,     XtCXmcGlitch,   screen.xmc_glitch,      0),
+Ires(XtNxmcAttributes, XtCXmcAttributes, screen.xmc_attributes, 1),
+Bres(XtNxmcInline,     XtCXmcInline,   screen.xmc_inline,      FALSE),
+Bres(XtNxmcMoveSGR,    XtCXmcMoveSGR,  screen.move_sgr_ok,     TRUE),
+#endif
+Bres(XtNcutNewline,    XtCCutNewline,  screen.cutNewline,      TRUE),
+Bres(XtNcutToBeginningOfLine, XtCCutToBeginningOfLine, screen.cutToBeginningOfLine, TRUE),
+Bres(XtNhighlightSelection, XtCHighlightSelection, screen.highlight_selection, FALSE),
+Bres(XtNtrimSelection, XtCTrimSelection, screen.trim_selection, FALSE),
 {XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
        XtOffsetOf(XtermWidgetRec, core.background_pixel),
        XtRString, XtDefaultBackground},
 Cres(XtNforeground,    screen.foreground,      XtDefaultForeground),
 Cres(XtNcursorColor,   screen.cursorcolor,     XtDefaultForeground),
 #if OPT_BLINK_CURS
-{XtNcursorBlink, XtCCursorBlink, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.cursor_blink),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNcursorOnTime, XtCCursorOnTime, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.cursor_on),
-       XtRInt, (XtPointer) &defaultBlinkOnTime},
-{XtNcursorOffTime, XtCCursorOffTime, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.cursor_off),
-       XtRInt, (XtPointer) &defaultBlinkOffTime},
-#endif
-{XtNkeyboardDialect, XtCKeyboardDialect, XtRString, sizeof(String),
-       XtOffsetOf(XtermWidgetRec, screen.keyboard_dialect),
-       XtRString, (XtPointer) DFT_KBD_DIALECT},
-{XtNeightBitInput, XtCEightBitInput, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.input_eight_bits),
-       XtRBoolean, (XtPointer) &defaultTRUE},
-{XtNeightBitOutput, XtCEightBitOutput, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.output_eight_bits),
-       XtRBoolean, (XtPointer) &defaultTRUE},
-{XtNeightBitControl, XtCEightBitControl, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.control_eight_bits),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNmetaSendsEscape, XtCMetaSendsEscape, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.meta_sends_esc),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNgeometry,XtCGeometry, XtRString, sizeof(char *),
-       XtOffsetOf(XtermWidgetRec, misc.geo_metry),
-       XtRString, (XtPointer) NULL},
-{XtNalwaysHighlight,XtCAlwaysHighlight,XtRBoolean,
-       sizeof(Boolean),XtOffsetOf(XtermWidgetRec, screen.always_highlight),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNappcursorDefault,XtCAppcursorDefault,XtRBoolean,
-       sizeof(Boolean),XtOffsetOf(XtermWidgetRec, misc.appcursorDefault),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNappkeypadDefault,XtCAppkeypadDefault,XtRBoolean,
-       sizeof(Boolean),XtOffsetOf(XtermWidgetRec, misc.appkeypadDefault),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNbackarrowKey, XtCBackarrowKey, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.backarrow_key),
-       XtRBoolean, (XtPointer) &defaultTRUE},
-{XtNbellSuppressTime, XtCBellSuppressTime, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.bellSuppressTime),
-       XtRInt, (XtPointer) &defaultBellSuppressTime},
-{XtNtekGeometry,XtCGeometry, XtRString, sizeof(char *),
-       XtOffsetOf(XtermWidgetRec, misc.T_geometry),
-       XtRString, (XtPointer) NULL},
-{XtNinternalBorder,XtCBorderWidth,XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.border),
-       XtRInt, (XtPointer) &defaultIntBorder},
-{XtNjumpScroll, XtCJumpScroll, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.jumpscroll),
-       XtRBoolean, (XtPointer) &defaultTRUE},
-{XtNoldXtermFKeys, XtCOldXtermFKeys, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.old_fkeys),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-Bres(XtNdeleteIsDEL,   XtCDeleteIsDEL,         screen.delete_is_del,   2),
+Bres(XtNcursorBlink,   XtCCursorBlink, screen.cursor_blink,    FALSE),
+Ires(XtNcursorOnTime,  XtCCursorOnTime, screen.cursor_on,      600),
+Ires(XtNcursorOffTime, XtCCursorOffTime, screen.cursor_off,    300),
+#endif
+Sres(XtNkeyboardDialect, XtCKeyboardDialect, screen.keyboard_dialect, DFT_KBD_DIALECT),
+Bres(XtNeightBitInput, XtCEightBitInput, screen.input_eight_bits, TRUE),
+Bres(XtNeightBitOutput, XtCEightBitOutput, screen.output_eight_bits, TRUE),
+Bres(XtNeightBitControl, XtCEightBitControl, screen.control_eight_bits, FALSE),
+Bres(XtNmetaSendsEscape, XtCMetaSendsEscape, screen.meta_sends_esc, FALSE),
+Sres(XtNgeometry,      XtCGeometry, misc.geo_metry,            NULL),
+Bres(XtNalwaysHighlight, XtCAlwaysHighlight, screen.always_highlight, FALSE),
+Bres(XtNappcursorDefault, XtCAppcursorDefault, misc.appcursorDefault, FALSE),
+Bres(XtNappkeypadDefault, XtCAppkeypadDefault, misc.appkeypadDefault, FALSE),
+Bres(XtNbackarrowKey, XtCBackarrowKey, screen.backarrow_key, TRUE),
+Ires(XtNbellSuppressTime, XtCBellSuppressTime, screen.bellSuppressTime, BELLSUPPRESSMSEC),
+Sres(XtNtekGeometry,   XtCGeometry, misc.T_geometry,           NULL),
+Ires(XtNinternalBorder, XtCBorderWidth, screen.border,         DEFBORDER),
+Bres(XtNjumpScroll,    XtCJumpScroll, screen.jumpscroll,       TRUE),
+Bres(XtNoldXtermFKeys, XtCOldXtermFKeys, screen.old_fkeys,     FALSE),
+Bres(XtNdeleteIsDEL,   XtCDeleteIsDEL, screen.delete_is_del,   2),
 #ifdef ALLOWLOGGING
-{XtNlogFile, XtCLogfile, XtRString, sizeof(char *),
-       XtOffsetOf(XtermWidgetRec, screen.logfile),
-       XtRString, (XtPointer) NULL},
-{XtNlogging, XtCLogging, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.log_on),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNlogInhibit, XtCLogInhibit, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.logInhibit),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-#endif
-{XtNloginShell, XtCLoginShell, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.login_shell),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNmarginBell, XtCMarginBell, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.marginbell),
-       XtRBoolean, (XtPointer) &defaultFALSE},
+Sres(XtNlogFile,       XtCLogfile, screen.logfile,             NULL),
+Bres(XtNlogging,       XtCLogging, misc.log_on,                FALSE),
+Bres(XtNlogInhibit,    XtCLogInhibit, misc.logInhibit,         FALSE),
+#endif
+Bres(XtNloginShell,    XtCLoginShell, misc.login_shell,        FALSE),
+Bres(XtNmarginBell,    XtCMarginBell, screen.marginbell,       FALSE),
 Cres(XtNpointerColor,  screen.mousecolor,      XtDefaultForeground),
 {XtNpointerColorBackground, XtCBackground, XtRPixel, sizeof(Pixel),
        XtOffsetOf(XtermWidgetRec, screen.mousecolorback),
@@ -498,147 +401,70 @@
 {XtNpointerShape,XtCCursor, XtRCursor, sizeof(Cursor),
        XtOffsetOf(XtermWidgetRec, screen.pointer_cursor),
        XtRString, (XtPointer) "xterm"},
-{XtNanswerbackString,XtCAnswerbackString, XtRString, sizeof(String),
-       XtOffsetOf(XtermWidgetRec, screen.answer_back),
-       XtRString, (XtPointer) ""},
+Sres(XtNanswerbackString, XtCAnswerbackString, screen.answer_back, ""),
 #if OPT_PRINT_COLORS
-{XtNprintAttributes,XtCPrintAttributes, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.print_attributes),
-       XtRInt, (XtPointer) &defaultONE},
-#endif
-{XtNprinterAutoClose,XtCPrinterAutoClose, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.printer_autoclose),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNprinterControlMode, XtCPrinterControlMode, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.printer_controlmode),
-       XtRInt, (XtPointer) &defaultZERO},
+Ires(XtNprintAttributes, XtCPrintAttributes, screen.print_attributes, 1),
+#endif
+Bres(XtNprinterAutoClose, XtCPrinterAutoClose, screen.printer_autoclose, FALSE),
+Ires(XtNprinterControlMode, XtCPrinterControlMode, screen.printer_controlmode, 0),
 #ifdef VMS
 #define OS_DEPENDENT_PRINT_COMMAND "print/delete/noflag"
 #else  /* VMS */
 #define OS_DEPENDENT_PRINT_COMMAND "lpr"
 #endif /* VMS */
-{XtNprinterCommand,XtCPrinterCommand, XtRString, sizeof(String),
-       XtOffsetOf(XtermWidgetRec, screen.printer_command),
-       XtRString, (XtPointer) OS_DEPENDENT_PRINT_COMMAND},
-{XtNprinterExtent,XtCPrinterExtent, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.printer_extent),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNprinterFormFeed,XtCPrinterFormFeed, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.printer_formfeed),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNmultiClickTime,XtCMultiClickTime, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.multiClickTime),
-       XtRInt, (XtPointer) &defaultMultiClickTime},
-{XtNmultiScroll,XtCMultiScroll, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.multiscroll),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNnMarginBell,XtCColumn, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.nmarginbell),
-       XtRInt, (XtPointer) &defaultNMarginBell},
-{XtNreverseVideo,XtCReverseVideo,XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.re_verse),
-       XtRBoolean, (XtPointer) &defaultFALSE},
+Sres(XtNprinterCommand,        XtCPrinterCommand, screen.printer_command, OS_DEPENDENT_PRINT_COMMAND),
+Bres(XtNprinterExtent, XtCPrinterExtent, screen.printer_extent, FALSE),
+Bres(XtNprinterFormFeed, XtCPrinterFormFeed, screen.printer_formfeed, FALSE),
+Ires(XtNmultiClickTime, XtCMultiClickTime, screen.multiClickTime, MULTICLICKTIME),
+Bres(XtNmultiScroll,   XtCMultiScroll, screen.multiscroll, FALSE),
+Ires(XtNnMarginBell,   XtCColumn, screen.nmarginbell, N_MARGINBELL),
+Bres(XtNreverseVideo,  XtCReverseVideo, misc.re_verse, FALSE),
 {XtNresizeGravity, XtCResizeGravity, XtRGravity, sizeof(XtGravity),
        XtOffsetOf(XtermWidgetRec, misc.resizeGravity),
        XtRImmediate, (XtPointer) SouthWestGravity},
-{XtNreverseWrap,XtCReverseWrap, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.reverseWrap),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNautoWrap,XtCAutoWrap, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.autoWrap),
-       XtRBoolean, (XtPointer) &defaultTRUE},
-{XtNsaveLines, XtCSaveLines, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.savelines),
-       XtRInt, (XtPointer) &defaultSaveLines},
-{XtNscrollBar, XtCScrollBar, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.scrollbar),
-       XtRBoolean, (XtPointer) &defaultFALSE},
+Bres(XtNreverseWrap,   XtCReverseWrap, misc.reverseWrap,       FALSE),
+Bres(XtNautoWrap,      XtCAutoWrap,    misc.autoWrap,          TRUE),
+Ires(XtNsaveLines,     XtCSaveLines,   screen.savelines,       SAVELINES),
+Bres(XtNscrollBar,     XtCScrollBar,   misc.scrollbar,         FALSE),
 #ifdef SCROLLBAR_RIGHT
-{XtNrightScrollBar, XtCRightScrollBar, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.useRight),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-#endif
-{XtNscrollTtyOutput,XtCScrollCond, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.scrollttyoutput),
-       XtRBoolean, (XtPointer) &defaultTRUE},
-{XtNscrollKey, XtCScrollCond, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.scrollkey),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNscrollLines, XtCScrollLines, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.scrolllines),
-       XtRInt, (XtPointer) &defaultScrollLines},
-{XtNsignalInhibit,XtCSignalInhibit,XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.signalInhibit),
-       XtRBoolean, (XtPointer) &defaultFALSE},
+Bres(XtNrightScrollBar, XtCRightScrollBar, misc.useRight, FALSE),
+#endif
+Bres(XtNscrollTtyOutput, XtCScrollCond, screen.scrollttyoutput, TRUE),
+Bres(XtNscrollKey,     XtCScrollCond,  screen.scrollkey,       FALSE),
+Ires(XtNscrollLines,   XtCScrollLines, screen.scrolllines,     SCROLLLINES),
+Bres(XtNsignalInhibit, XtCSignalInhibit, misc.signalInhibit,   FALSE),
 #if OPT_NUM_LOCK
-{XtNnumLock, XtCNumLock, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.real_NumLock),
-       XtRBoolean, (XtPointer) &defaultTRUE},
+Bres(XtNnumLock,       XtCNumLock,     misc.real_NumLock,      TRUE),
 #endif
 #if OPT_SHIFT_KEYS
-{XtNshiftKeys, XtCShiftKeys, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.shift_keys),
-       XtRBoolean, (XtPointer) &defaultTRUE},
+Bres(XtNshiftKeys,     XtCShiftKeys,   misc.shift_keys,        TRUE),
+#endif
+#if OPT_SUNPC_KBD
+Ires(XtNctrlFKeys,     XtCCtrlFKeys,   misc.ctrl_fkeys,        10),
 #endif
 #if OPT_TEK4014
-{XtNtekInhibit, XtCTekInhibit, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.tekInhibit),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNtekSmall, XtCTekSmall, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.tekSmall),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNtekStartup, XtCTekStartup, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.TekEmu),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-#endif
-{XtNtiteInhibit, XtCTiteInhibit, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.titeInhibit),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNvisualBell, XtCVisualBell, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.visualbell),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNallowSendEvents, XtCAllowSendEvents, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.allowSendEvents),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNawaitInput, XtCAwaitInput, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.awaitInput),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{"font1", "Font1", XtRString, sizeof(String),
-       XtOffsetOf(XtermWidgetRec, screen.menu_font_names[fontMenu_font1]),
-       XtRString, (XtPointer) NULL},
-{"font2", "Font2", XtRString, sizeof(String),
-       XtOffsetOf(XtermWidgetRec, screen.menu_font_names[fontMenu_font2]),
-       XtRString, (XtPointer) NULL},
-{"font3", "Font3", XtRString, sizeof(String),
-       XtOffsetOf(XtermWidgetRec, screen.menu_font_names[fontMenu_font3]),
-       XtRString, (XtPointer) NULL},
-{"font4", "Font4", XtRString, sizeof(String),
-       XtOffsetOf(XtermWidgetRec, screen.menu_font_names[fontMenu_font4]),
-       XtRString, (XtPointer) NULL},
-{"font5", "Font5", XtRString, sizeof(String),
-       XtOffsetOf(XtermWidgetRec, screen.menu_font_names[fontMenu_font5]),
-       XtRString, (XtPointer) NULL},
-{"font6", "Font6", XtRString, sizeof(String),
-       XtOffsetOf(XtermWidgetRec, screen.menu_font_names[fontMenu_font6]),
-       XtRString, (XtPointer) NULL},
+Bres(XtNtekInhibit,    XtCTekInhibit,  misc.tekInhibit,        FALSE),
+Bres(XtNtekSmall,      XtCTekSmall,    misc.tekSmall,          FALSE),
+Bres(XtNtekStartup,    XtCTekStartup,  screen.TekEmu,          FALSE),
+#endif
+Bres(XtNtiteInhibit,   XtCTiteInhibit, misc.titeInhibit,       FALSE),
+Bres(XtNvisualBell,    XtCVisualBell,  screen.visualbell,      FALSE),
+Bres(XtNallowSendEvents, XtCAllowSendEvents, screen.allowSendEvents, FALSE),
+Bres(XtNawaitInput,    XtCAwaitInput,  screen.awaitInput,      FALSE),
+Sres("font1", "Font1", screen.menu_font_names[fontMenu_font1], NULL),
+Sres("font2", "Font2", screen.menu_font_names[fontMenu_font2], NULL),
+Sres("font3", "Font3", screen.menu_font_names[fontMenu_font3], NULL),
+Sres("font4", "Font4", screen.menu_font_names[fontMenu_font4], NULL),
+Sres("font5", "Font5", screen.menu_font_names[fontMenu_font5], NULL),
+Sres("font6", "Font6", screen.menu_font_names[fontMenu_font6], NULL),
 #if OPT_DEC_CHRSET
-{XtNfontDoublesize, XtCFontDoublesize, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.font_doublesize),
-       XtRBoolean, (XtPointer) &defaultTRUE},
-{XtNcacheDoublesize, XtCCacheDoublesize, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.cache_doublesize),
-       XtRInt, (XtPointer) &default_NUM_CHRSET},
+Bres(XtNfontDoublesize, XtCFontDoublesize, screen.font_doublesize, TRUE),
+Ires(XtNcacheDoublesize, XtCCacheDoublesize, screen.cache_doublesize, NUM_CHRSET),
 #endif
 #if OPT_INPUT_METHOD
-{XtNinputMethod, XtCInputMethod, XtRString, sizeof(char*),
-       XtOffsetOf(XtermWidgetRec, misc.input_method),
-       XtRString, (XtPointer)NULL},
-{XtNpreeditType, XtCPreeditType, XtRString, sizeof(char*),
-       XtOffsetOf(XtermWidgetRec, misc.preedit_type),
-       XtRString, (XtPointer)"Root"},
-{XtNopenIm, XtCOpenIm, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.open_im),
-       XtRImmediate, (XtPointer)TRUE},
+Sres(XtNinputMethod,   XtCInputMethod, misc.input_method,      NULL),
+Sres(XtNpreeditType,   XtCPreeditType, misc.preedit_type,      "Root"),
+Bres(XtNopenIm,                XtCOpenIm,      misc.open_im,           TRUE),
 #endif
 #if OPT_ISO_COLORS
 COLOR_RES(XtNcolor0,   screen.Acolors[COLOR_0],        DFT_COLOR("black")),
@@ -665,50 +491,26 @@
 COLOR_RES(XtNcolorBD,  screen.Acolors[COLOR_BD],       DFT_COLOR(XtDefaultForeground)),
 COLOR_RES(XtNcolorBL,  screen.Acolors[COLOR_BL],       DFT_COLOR(XtDefaultForeground)),
 COLOR_RES(XtNcolorUL,  screen.Acolors[COLOR_UL],       DFT_COLOR(XtDefaultForeground)),
-{XtNcolorMode, XtCColorMode, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.colorMode),
-       XtRBoolean, (XtPointer) &defaultCOLORMODE},
-{XtNcolorULMode, XtCColorMode, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.colorULMode),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNcolorBDMode, XtCColorMode, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.colorBDMode),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNcolorBLMode, XtCColorMode, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.colorBLMode),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNcolorAttrMode, XtCColorMode, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.colorAttrMode),
-       XtRBoolean, (XtPointer) &defaultFALSE},
-{XtNboldColors, XtCColorMode, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.boldColors),
-       XtRBoolean, (XtPointer) &defaultTRUE},
+Bres(XtNcolorMode,     XtCColorMode, screen.colorMode, DFT_COLORMODE),
+Bres(XtNcolorULMode,   XtCColorMode, screen.colorULMode,       FALSE),
+Bres(XtNcolorBDMode,   XtCColorMode, screen.colorBDMode,       FALSE),
+Bres(XtNcolorBLMode,   XtCColorMode, screen.colorBLMode,       FALSE),
+Bres(XtNcolorAttrMode, XtCColorMode, screen.colorAttrMode,     FALSE),
+Bres(XtNboldColors,    XtCColorMode, screen.boldColors,        TRUE),
 #endif /* OPT_ISO_COLORS */
-{XtNdynamicColors, XtCDynamicColors, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.dynamicColors),
-       XtRBoolean, (XtPointer) &defaultTRUE},
+Bres(XtNdynamicColors, XtCDynamicColors, misc.dynamicColors,   TRUE),
 #if OPT_HIGHLIGHT_COLOR
 Cres(XtNhighlightColor,        screen.highlightcolor,  XtDefaultForeground),
 #endif /* OPT_HIGHLIGHT_COLOR */
-{XtNboldMode, XtCBoldMode, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.bold_mode),
-       XtRBoolean, (XtPointer) &defaultTRUE},
-{XtNunderLine, XtCUnderLine, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.underline),
-       XtRBoolean, (XtPointer) &defaultTRUE},
-{XtNdecTerminalID, XtCDecTerminalID, XtRString, sizeof(String),
-       XtOffsetOf(XtermWidgetRec, screen.term_id),
-       XtRString, (XtPointer) DFT_DECID},
+Bres(XtNboldMode,      XtCBoldMode, screen.bold_mode,          TRUE),
+Bres(XtNunderLine,     XtCUnderLine, screen.underline,         TRUE),
+Sres(XtNdecTerminalID, XtCDecTerminalID, screen.term_id,       DFT_DECID),
 #ifndef NO_ACTIVE_ICON
-{"activeIcon", "ActiveIcon", XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, misc.active_icon),
-       XtRString, "false"},
+Bres("activeIcon",     "ActiveIcon", misc.active_icon,         FALSE),
 {"iconFont", "IconFont", XtRFontStruct, sizeof(XFontStruct),
        XtOffsetOf(XtermWidgetRec, screen.fnt_icon),
        XtRString, (XtPointer)XtExtdefaultfont},
-{"iconBorderWidth", XtCBorderWidth, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, misc.icon_border_width),
-       XtRString, "2"},
+Ires("iconBorderWidth", XtCBorderWidth, misc.icon_border_width, 2),
 {"iconBorderColor", XtCBorderColor, XtRPixel, sizeof(Pixel),
        XtOffsetOf(XtermWidgetRec, misc.icon_border_pixel),
        XtRString, XtExtdefaultbackground},
@@ -717,17 +519,13 @@
 {XtNmenuBar, XtCMenuBar, XtRWidget, sizeof(Widget),
        XtOffsetOf(XtermWidgetRec, screen.fullVwin.menu_bar),
        XtRWidget, (XtPointer) 0},
-{XtNmenuHeight, XtCMenuHeight, XtRInt, sizeof(int),
-       XtOffsetOf(XtermWidgetRec, screen.fullVwin.menu_height),
-       XtRString, "25"},
+Ires(XtNmenuHeight, XtCMenuHeight, screen.fullVwin.menu_height, 25),
 #endif
 #if OPT_WIDE_CHARS
 {XtNutf8, XtCUtf8, XtRInt, sizeof(int),
        XtOffsetOf(XtermWidgetRec, screen.utf8_mode),
        XtRString, defaultUTF8},
-{XtNwideChars, XtCWideChars, XtRBoolean, sizeof(Boolean),
-       XtOffsetOf(XtermWidgetRec, screen.wide_chars),
-       XtRBoolean, (XtPointer) &defaultFALSE},
+Bres(XtNwideChars, XtCWideChars, screen.wide_chars, FALSE),
 #endif
 };
 
@@ -4191,7 +3989,7 @@
    wnew->screen.old_fkeys = request->screen.old_fkeys;
    wnew->screen.delete_is_del = request->screen.delete_is_del;
    wnew->keyboard.type = wnew->screen.old_fkeys
-               ? keyboardIsLegacy
+               ? keyboardIsLegacy
                : keyboardIsDefault;
 #ifdef ALLOWLOGGING
    wnew->screen.logfile = request->screen.logfile;
@@ -4233,6 +4031,9 @@
 #endif
 #if OPT_SHIFT_KEYS
    wnew->misc.shift_keys = request->misc.shift_keys;
+#endif
+#if OPT_SUNPC_KBD
+   wnew->misc.ctrl_fkeys = request->misc.ctrl_fkeys;
 #endif
 #if OPT_TEK4014
    wnew->misc.tekInhibit = request->misc.tekInhibit;
Index: config.guess
--- xterm-131+/config.guess     Sun May 16 15:55:44 1999
+++ xterm-132/config.guess      Tue Nov 30 22:38:43 1999
@@ -150,6 +150,9 @@
                echo pyramid-pyramid-bsd
        fi
        exit 0 ;;
+    "Power Macintosh":Rhapsody:*:*)
+       echo powerpc-apple-rhapsody`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
     NILE:*:*:dcosx)
        echo pyramid-pyramid-svr4
        exit 0 ;;
@@ -563,7 +566,7 @@
          sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
          armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
          m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-         elf32ppc)   echo "powerpc-unknown-linux-gnu"              ; exit 0 ;;
+         elf32ppc*)  echo "powerpc-unknown-linux-gnu"              ; exit 0 ;;
        esac
 
        if test "${UNAME_MACHINE}" = "alpha" ; then
Index: config.sub
--- xterm-131+/config.sub       Sun May 16 15:55:44 1999
+++ xterm-132/config.sub        Sat Jan  1 12:48:23 2000
@@ -68,6 +68,10 @@
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
+  hurd-gnu*)
+    os=$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
   linux-gnu*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -157,7 +161,7 @@
                | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
                | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
                | mipstx39 | mipstx39el \
-               | sparc | sparclet | sparclite | sparc64 | v850)
+               | sparc | sparclet | sparclite | sparc64 | v850 | ia64)
                basic_machine=$basic_machine-unknown
                ;;
        # We use `pc' rather than `unknown'
@@ -184,7 +188,7 @@
              | sparc64-* | mips64-* | mipsel-* \
              | mips64el-* | mips64orion-* | mips64orionel-*  \
              | mipstx39-* | mipstx39el-* \
-             | f301-*)
+             | f301-* | ia64-*)
                ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
@@ -728,6 +732,9 @@
                ;;
        -linux*)
                os=`echo $os | sed -e 's|linux|linux-gnu|'`
+               ;;
+       -hurd*)
+               os=`echo $os `
                ;;
        -sunos5*)
                os=`echo $os | sed -e 's|sunos5|solaris2|'`
Index: configure
--- xterm-131+/configure        Sat Mar  4 04:36:01 2000
+++ xterm-132/configure Tue Apr 11 19:52:04 2000
@@ -2429,8 +2429,65 @@
 
 
 
-echo $ac_n "checking for tty group""... $ac_c" 1>&6
-echo "configure:2434: checking for tty group" >&5
+echo $ac_n "checking for tty group name""... $ac_c" 1>&6
+echo "configure:2434: checking for tty group name" >&5
+if eval "test \"`echo '$''{'cf_cv_tty_group_name'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+
+# If we are configuring as root, it is hard to get a clue about the tty group.
+# But we'll guess based on how our connection is set up - assuming it is done
+# properly.
+
+cf_uid=`id | sed -e 's/^^=*=//' -e 's/(.*$//'`
+if test "$cf_uid" != 0 ; then
+cf_cv_tty_group_name=
+cf_tty_name=`tty`
+test -z "$cf_tty_name" && cf_tty_name=/dev/tty
+if test -c $cf_tty_name
+then
+       cf_option="-l -L"
+
+       # Expect listing to have fields like this:
+       #-rwxrwxrwx   1 user      group       34293 Jul 18 16:29 pathname
+       ls $cf_option $cf_tty_name >conftest.out
+       read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest <conftest.out
+       if test -z "$cf_rest" ; then
+               cf_option="$cf_option -g"
+               ls $cf_option $cf_tty_name >conftest.out
+               read cf_mode cf_links cf_usr cf_grp cf_size cf_date1 cf_date2 cf_date3 cf_rest <conftest.out
+       fi
+       rm -f conftest.out
+       cf_cv_tty_group_name=$cf_grp
+fi
+fi
+
+# If we cannot deduce the tty group, fall back on hardcoded cases
+
+if test -z "$cf_cv_tty_group_name"
+then
+case $host_os in #(vi
+osf*) #(vi
+       cf_cv_tty_group_name="terminal"
+       ;;
+*)
+       cf_cv_tty_group_name="tty"
+       ;;
+esac
+fi
+
+fi
+
+echo "$ac_t""$cf_cv_tty_group_name" 1>&6
+
+cat >> confdefs.h <<EOF
+#define TTY_GROUP_NAME "$cf_cv_tty_group_name"
+EOF
+
+
+echo $ac_n "checking if we may use tty group""... $ac_c" 1>&6
+echo "configure:2491: checking if we may use tty group" >&5
 if eval "test \"`echo '$''{'cf_cv_tty_group'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2439,21 +2496,32 @@
   cf_cv_tty_group=unknown
 else
   cat > conftest.$ac_ext <<EOF
-#line 2443 "configure"
+#line 2500 "configure"
 #include "confdefs.h"
 
+#include <unistd.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <grp.h>
 int main()
 {
-       struct group *ttygrp;
-       int code = (ttygrp = getgrnam("tty")) == 0;
+       struct stat sb;
+       struct group *ttygrp = getgrnam(TTY_GROUP_NAME);
+       char *name = ttyname(0);
+
        endgrent();
-       exit(code);
+       if (ttygrp != 0
+        && name != 0
+        && stat(name, &sb) == 0
+        && sb.st_gid != getgid()
+        && sb.st_gid == ttygrp->gr_gid) {
+               exit(0);
+       }
+       exit(1);
 }
        
 EOF
-if { (eval echo configure:2457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   cf_cv_tty_group=yes
 else
@@ -2478,7 +2546,7 @@
 ###    checks for compiler characteristics
 
 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:2482: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:2550: checking for ${CC-cc} option to accept ANSI C" >&5
 if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2502,7 +2570,7 @@
 do
        CFLAGS="$cf_save_CFLAGS $cf_arg"
        cat > conftest.$ac_ext <<EOF
-#line 2506 "configure"
+#line 2574 "configure"
 #include "confdefs.h"
 
 #ifndef CC_HAS_PROTOS
@@ -2518,7 +2586,7 @@
        struct s2 {int (*f) (double a);};
 ; return 0; }
 EOF
-if { (eval echo configure:2522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_ansi_cc="$cf_arg"; break
 else
@@ -2545,12 +2613,12 @@
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2549: checking for working const" >&5
+echo "configure:2617: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2554 "configure"
+#line 2622 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2599,7 +2667,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2623,12 +2691,12 @@
 ###    checks for system services and user specified options
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2627: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:2695: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2632 "configure"
+#line 2700 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -2644,7 +2712,7 @@
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:2648: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -2667,13 +2735,13 @@
 
 
 echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
-echo "configure:2671: checking if we must define _GNU_SOURCE" >&5
+echo "configure:2739: checking if we must define _GNU_SOURCE" >&5
 if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 2677 "configure"
+#line 2745 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -2683,7 +2751,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:2687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_gnu_source=no
 else
@@ -2693,7 +2761,7 @@
   cf_save="$CFLAGS"
         CFLAGS="$CFLAGS -D_GNU_SOURCE"
         cat > conftest.$ac_ext <<EOF
-#line 2697 "configure"
+#line 2765 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
@@ -2703,7 +2771,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:2707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_gnu_source=no
 else
@@ -2728,7 +2796,7 @@
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:2732: checking for X" >&5
+echo "configure:2800: checking for X" >&5
 
 
 # Check whether --with-x or --without-x was given.
@@ -2791,12 +2859,12 @@
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 2795 "configure"
+#line 2863 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2865,14 +2933,14 @@
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2869 "configure"
+#line 2937 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:2876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -2972,7 +3040,7 @@
        # FIXME: modify the library lookup in autoconf to
        # allow _s.a suffix ahead of .a
        echo $ac_n "checking for open in -lc_s""... $ac_c" 1>&6
-echo "configure:2976: checking for open in -lc_s" >&5
+echo "configure:3044: checking for open in -lc_s" >&5
 ac_lib_var=`echo c_s'_'open | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2980,7 +3048,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lc_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2984 "configure"
+#line 3052 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2991,7 +3059,7 @@
 open()
 ; return 0; }
 EOF
-if { (eval echo configure:2995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3008,7 +3076,7 @@
   echo "$ac_t""yes" 1>&6
   LIBS="-lc_s $LIBS"
        echo $ac_n "checking for gethostname in -lbsd""... $ac_c" 1>&6
-echo "configure:3012: checking for gethostname in -lbsd" >&5
+echo "configure:3080: checking for gethostname in -lbsd" >&5
 ac_lib_var=`echo bsd'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3016,7 +3084,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lbsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3020 "configure"
+#line 3088 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3027,7 +3095,7 @@
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:3031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3044,7 +3112,7 @@
   echo "$ac_t""yes" 1>&6
   LIBS="-lbsd $LIBS"
        echo $ac_n "checking for gethostname in -lnsl_s""... $ac_c" 1>&6
-echo "configure:3048: checking for gethostname in -lnsl_s" >&5
+echo "configure:3116: checking for gethostname in -lnsl_s" >&5
 ac_lib_var=`echo nsl_s'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3052,7 +3120,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3056 "configure"
+#line 3124 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3063,7 +3131,7 @@
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:3067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3080,7 +3148,7 @@
   echo "$ac_t""yes" 1>&6
   LIBS="-lnsl_s $LIBS"
        echo $ac_n "checking for XOpenDisplay in -lX11_s""... $ac_c" 1>&6
-echo "configure:3084: checking for XOpenDisplay in -lX11_s" >&5
+echo "configure:3152: checking for XOpenDisplay in -lX11_s" >&5
 ac_lib_var=`echo X11_s'_'XOpenDisplay | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3088,7 +3156,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lX11_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3092 "configure"
+#line 3160 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3099,7 +3167,7 @@
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:3103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3116,7 +3184,7 @@
   echo "$ac_t""yes" 1>&6
   LIBS="-lX11_s $LIBS"
        echo $ac_n "checking for XtAppInitialize in -lXt_s""... $ac_c" 1>&6
-echo "configure:3120: checking for XtAppInitialize in -lXt_s" >&5
+echo "configure:3188: checking for XtAppInitialize in -lXt_s" >&5
 ac_lib_var=`echo Xt_s'_'XtAppInitialize | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3124,7 +3192,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXt_s  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3128 "configure"
+#line 3196 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3135,7 +3203,7 @@
 XtAppInitialize()
 ; return 0; }
 EOF
-if { (eval echo configure:3139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3176,7 +3244,7 @@
        ;;
 *)
        echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:3180: checking for socket in -lsocket" >&5
+echo "configure:3248: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3184,7 +3252,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3188 "configure"
+#line 3256 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3195,7 +3263,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:3199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3223,7 +3291,7 @@
 fi
 
        echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6
-echo "configure:3227: checking for gethostname in -lnsl" >&5
+echo "configure:3295: checking for gethostname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3231,7 +3299,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3235 "configure"
+#line 3303 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3242,7 +3310,7 @@
 gethostname()
 ; return 0; }
 EOF
-if { (eval echo configure:3246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3293,17 +3361,17 @@
     case "`(uname -sr) 2>/dev/null`" in
     "SunOS 5"*)
       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:3297: checking whether -R must be followed by a space" >&5
+echo "configure:3365: checking whether -R must be followed by a space" >&5
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 3300 "configure"
+#line 3368 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -3319,14 +3387,14 @@
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat > conftest.$ac_ext <<EOF
-#line 3323 "configure"
+#line 3391 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -3358,7 +3426,7 @@
     # libraries were built with DECnet support.  And karl@cs.umb.edu says
     # the Alpha needs dnet_stub (dnet does not exist).
     echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:3362: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:3430: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3366,7 +3434,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3370 "configure"
+#line 3438 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3377,7 +3445,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:3381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3399,7 +3467,7 @@
 
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:3403: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:3471: checking for dnet_ntoa in -ldnet_stub" >&5
 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3407,7 +3475,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet_stub  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3411 "configure"
+#line 3479 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3418,7 +3486,7 @@
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:3422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3447,12 +3515,12 @@
     # The nsl library prevents programs from opening the X display
     # on Irix 5.2, according to dickey@clark.net.
     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:3451: checking for gethostbyname" >&5
+echo "configure:3519: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3456 "configure"
+#line 3524 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -3475,7 +3543,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -3496,7 +3564,7 @@
 
     if test $ac_cv_func_gethostbyname = no; then
       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3500: checking for gethostbyname in -lnsl" >&5
+echo "configure:3568: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3504,7 +3572,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3508 "configure"
+#line 3576 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3515,7 +3583,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:3519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3545,12 +3613,12 @@
     # -lsocket must be given before -lnsl if both are needed.
     # We assume that if connect needs -lnsl, so does gethostbyname.
     echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:3549: checking for connect" >&5
+echo "configure:3617: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3554 "configure"
+#line 3622 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -3573,7 +3641,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -3594,7 +3662,7 @@
 
     if test $ac_cv_func_connect = no; then
       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:3598: checking for connect in -lsocket" >&5
+echo "configure:3666: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3602,7 +3670,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3606 "configure"
+#line 3674 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3613,7 +3681,7 @@
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:3617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3637,12 +3705,12 @@
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:3641: checking for remove" >&5
+echo "configure:3709: checking for remove" >&5
 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3646 "configure"
+#line 3714 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -3665,7 +3733,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -3686,7 +3754,7 @@
 
     if test $ac_cv_func_remove = no; then
       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:3690: checking for remove in -lposix" >&5
+echo "configure:3758: checking for remove in -lposix" >&5
 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3694,7 +3762,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3698 "configure"
+#line 3766 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3705,7 +3773,7 @@
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:3709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3729,12 +3797,12 @@
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:3733: checking for shmat" >&5
+echo "configure:3801: checking for shmat" >&5
 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3738 "configure"
+#line 3806 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -3757,7 +3825,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -3778,7 +3846,7 @@
 
     if test $ac_cv_func_shmat = no; then
       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:3782: checking for shmat in -lipc" >&5
+echo "configure:3850: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3786,7 +3854,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lipc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3790 "configure"
+#line 3858 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3797,7 +3865,7 @@
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:3801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3830,7 +3898,7 @@
   # libraries we check for below, so use a different variable.
   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
   echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:3834: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:3902: checking for IceConnectionNumber in -lICE" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3838,7 +3906,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3842 "configure"
+#line 3910 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3849,7 +3917,7 @@
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:3853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3876,7 +3944,7 @@
        LDFLAGS="$LDFLAGS $X_LIBS"
        CFLAGS="$CFLAGS $X_CFLAGS"
        echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:3880: checking for XOpenDisplay in -lX11" >&5
+echo "configure:3948: checking for XOpenDisplay in -lX11" >&5
 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3884,7 +3952,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3888 "configure"
+#line 3956 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3895,7 +3963,7 @@
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:3899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3916,7 +3984,7 @@
 fi
 
        echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6
-echo "configure:3920: checking for XtAppInitialize in -lXt" >&5
+echo "configure:3988: checking for XtAppInitialize in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtAppInitialize | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3924,7 +3992,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3928 "configure"
+#line 3996 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3935,7 +4003,7 @@
 XtAppInitialize()
 ; return 0; }
 EOF
-if { (eval echo configure:3939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3991,17 +4059,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3995: checking for $ac_hdr" >&5
+echo "configure:4063: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4000 "configure"
+#line 4068 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4049,7 +4117,7 @@
 
 
 echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6
-echo "configure:4053: checking for XextCreateExtension in -lXext" >&5
+echo "configure:4121: checking for XextCreateExtension in -lXext" >&5
 ac_lib_var=`echo Xext'_'XextCreateExtension | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4057,7 +4125,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lXext  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4061 "configure"
+#line 4129 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4068,7 +4136,7 @@
 XextCreateExtension()
 ; return 0; }
 EOF
-if { (eval echo configure:4072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4104,13 +4172,13 @@
                if test $cf_path != default ; then
                        CFLAGS="-I$cf_path/include $cf_save"
                        echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6
-echo "configure:4108: checking for $cf_test in $cf_path" >&5
+echo "configure:4176: checking for $cf_test in $cf_path" >&5
                else
                        echo $ac_n "checking for $cf_test""... $ac_c" 1>&6
-echo "configure:4111: checking for $cf_test" >&5
+echo "configure:4179: checking for $cf_test" >&5
                fi
                cat > conftest.$ac_ext <<EOF
-#line 4114 "configure"
+#line 4182 "configure"
 #include "confdefs.h"
 
 #include <X11/Intrinsic.h>
@@ -4119,7 +4187,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4191: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -4145,21 +4213,21 @@
                        if test $cf_path != default ; then
                                LIBS="-L$cf_path/lib $cf_lib $LIBS"
                                echo $ac_n "checking for $cf_lib in $cf_path""... $ac_c" 1>&6
-echo "configure:4149: checking for $cf_lib in $cf_path" >&5
+echo "configure:4217: checking for $cf_lib in $cf_path" >&5
                        else
                                LIBS="$cf_lib $LIBS"
                                echo $ac_n "checking for $cf_test in $cf_lib""... $ac_c" 1>&6
-echo "configure:4153: checking for $cf_test in $cf_lib" >&5
+echo "configure:4221: checking for $cf_test in $cf_lib" >&5
                        fi
                        cat > conftest.$ac_ext <<EOF
-#line 4156 "configure"
+#line 4224 "configure"
 #include "confdefs.h"
 
 int main() {
 $cf_test()
 ; return 0; }
 EOF
-if { (eval echo configure:4163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_result=yes
 else
@@ -4197,13 +4265,13 @@
 
 
 echo $ac_n "checking for declaration of fd_set""... $ac_c" 1>&6
-echo "configure:4201: checking for declaration of fd_set" >&5
+echo "configure:4269: checking for declaration of fd_set" >&5
 if eval "test \"`echo '$''{'cf_cv_type_fd_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   echo "trying sys/types alone" 1>&5
 cat > conftest.$ac_ext <<EOF
-#line 4207 "configure"
+#line 4275 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -4211,7 +4279,7 @@
 fd_set x
 ; return 0; }
 EOF
-if { (eval echo configure:4215: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_type_fd_set=sys/types.h
 else
@@ -4220,7 +4288,7 @@
   rm -rf conftest*
   echo "trying X11/Xpoll.h" 1>&5
 cat > conftest.$ac_ext <<EOF
-#line 4224 "configure"
+#line 4292 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_X11_XPOLL_H
@@ -4230,7 +4298,7 @@
 fd_set x
 ; return 0; }
 EOF
-if { (eval echo configure:4234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_type_fd_set=X11/Xpoll.h
 else
@@ -4239,7 +4307,7 @@
   rm -rf conftest*
   echo "trying sys/select.h" 1>&5
 cat > conftest.$ac_ext <<EOF
-#line 4243 "configure"
+#line 4311 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -4248,7 +4316,7 @@
 fd_set x
 ; return 0; }
 EOF
-if { (eval echo configure:4252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cf_cv_type_fd_set=sys/select.h
 else
@@ -4282,12 +4350,12 @@
 for ac_func in grantpt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4286: checking for $ac_func" >&5
+echo "configure:4354: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4291 "configure"
+#line 4359 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4310,7 +4378,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4332,7 +4400,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6
-echo "configure:4336: checking for openpty in -lutil" >&5
+echo "configure:4404: checking for openpty in -lutil" >&5
 ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4340,7 +4408,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lutil  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4344 "configure"
+#line 4412 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4351,7 +4419,7 @@
 openpty()
 ; return 0; }
 EOF
-if { (eval echo configure:4355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4385,7 +4453,7 @@
 # Extract the first word of "xterm", so it can be a program name with args.
 set dummy xterm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4389: checking for $ac_word" >&5
+echo "configure:4457: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XTERM_PATH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4423,12 +4491,12 @@
        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4427: checking for $ac_func" >&5
+echo "configure:4495: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4432 "configure"
+#line 4500 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4451,7 +4519,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4477,7 +4545,7 @@
 
 
 echo $ac_n "checking if we should use imake to help""... $ac_c" 1>&6
-echo "configure:4481: checking if we should use imake to help" >&5
+echo "configure:4549: checking if we should use imake to help" >&5
 
 # Check whether --enable-imake or --disable-imake was given.
 if test "${enable_imake+set}" = set; then
@@ -4502,7 +4570,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4506: checking for $ac_word" >&5
+echo "configure:4574: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_IMAKE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4641,7 +4709,7 @@
 
 
 echo $ac_n "checking for default terminal-id""... $ac_c" 1>&6
-echo "configure:4645: checking for default terminal-id" >&5
+echo "configure:4713: checking for default terminal-id" >&5
 
 # Check whether --with-terminal-id or --without-terminal-id was given.
 if test "${with_terminal_id+set}" = set; then
@@ -4662,7 +4730,7 @@
 
 
 echo $ac_n "checking for default terminal-type""... $ac_c" 1>&6
-echo "configure:4666: checking for default terminal-type" >&5
+echo "configure:4734: checking for default terminal-type" >&5
 
 # Check whether --with-terminal-type or --without-terminal-type was given.
 if test "${with_terminal_type+set}" = set; then
@@ -4679,7 +4747,7 @@
 
 
 echo $ac_n "checking for private terminfo-directory""... $ac_c" 1>&6
-echo "configure:4683: checking for private terminfo-directory" >&5
+echo "configure:4751: checking for private terminfo-directory" >&5
 
 # Check whether --with-own-terminfo or --without-own-terminfo was given.
 if test "${with_own_terminfo+set}" = set; then
@@ -4718,7 +4786,7 @@
 
 ###    checks for optional features
 echo $ac_n "checking if you want active-icons""... $ac_c" 1>&6
-echo "configure:4722: checking if you want active-icons" >&5
+echo "configure:4790: checking if you want active-icons" >&5
 
 # Check whether --enable-active-icon or --disable-active-icon was given.
 if test "${enable_active_icon+set}" = set; then
@@ -4744,7 +4812,7 @@
 fi
 
 echo $ac_n "checking if you want ANSI color""... $ac_c" 1>&6
-echo "configure:4748: checking if you want ANSI color" >&5
+echo "configure:4816: checking if you want ANSI color" >&5
 
 # Check whether --enable-ansi-color or --disable-ansi-color was given.
 if test "${enable_ansi_color+set}" = set; then
@@ -4770,7 +4838,7 @@
 if test $enable_ansi_color = yes ; then
 
        echo $ac_n "checking if you want 16 colors like aixterm""... $ac_c" 1>&6
-echo "configure:4774: checking if you want 16 colors like aixterm" >&5
+echo "configure:4842: checking if you want 16 colors like aixterm" >&5
        
 # Check whether --enable-16-color or --disable-16-color was given.
 if test "${enable_16_color+set}" = set; then
@@ -4794,7 +4862,7 @@
 
 
        echo $ac_n "checking if you want 256 colors""... $ac_c" 1>&6
-echo "configure:4798: checking if you want 256 colors" >&5
+echo "configure:4866: checking if you want 256 colors" >&5
        
 # Check whether --enable-256-color or --disable-256-color was given.
 if test "${enable_256_color+set}" = set; then
@@ -4821,7 +4889,7 @@
 
        else
        echo $ac_n "checking if you want 88 colors""... $ac_c" 1>&6
-echo "configure:4825: checking if you want 88 colors" >&5
+echo "configure:4893: checking if you want 88 colors" >&5
        
 # Check whether --enable-88-color or --disable-88-color was given.
 if test "${enable_88_color+set}" = set; then
@@ -4852,7 +4920,7 @@
 fi
 
 echo $ac_n "checking if you want blinking cursor""... $ac_c" 1>&6
-echo "configure:4856: checking if you want blinking cursor" >&5
+echo "configure:4924: checking if you want blinking cursor" >&5
 
 # Check whether --enable-blink-cursor or --disable-blink-cursor was given.
 if test "${enable_blink_cursor+set}" = set; then
@@ -4878,7 +4946,7 @@
 if test $enable_ansi_color = yes ; then
 
        echo $ac_n "checking if you want bold colors mapped like IBM PC""... $ac_c" 1>&6
-echo "configure:4882: checking if you want bold colors mapped like IBM PC" >&5
+echo "configure:4950: checking if you want bold colors mapped like IBM PC" >&5
        
 # Check whether --enable-bold-color or --disable-bold-color was given.
 if test "${enable_bold_color+set}" = set; then
@@ -4902,7 +4970,7 @@
 
 
        echo $ac_n "checking if you want color-mode enabled by default""... $ac_c" 1>&6
-echo "configure:4906: checking if you want color-mode enabled by default" >&5
+echo "configure:4974: checking if you want color-mode enabled by default" >&5
        
 # Check whether --enable-color-mode or --disable-color-mode was given.
 if test "${enable_color_mode+set}" = set; then
@@ -4928,7 +4996,7 @@
 fi
 
 echo $ac_n "checking if you want support for color highlighting""... $ac_c" 1>&6
-echo "configure:4932: checking if you want support for color highlighting" >&5
+echo "configure:5000: checking if you want support for color highlighting" >&5
 
 # Check whether --enable-highlighting or --disable-highlighting was given.
 if test "${enable_highlighting+set}" = set; then
@@ -4952,7 +5020,7 @@
 
 
 echo $ac_n "checking if you want support for doublesize characters""... $ac_c" 1>&6
-echo "configure:4956: checking if you want support for doublesize characters" >&5
+echo "configure:5024: checking if you want support for doublesize characters" >&5
 
 # Check whether --enable-doublechars or --disable-doublechars was given.
 if test "${enable_doublechars+set}" = set; then
@@ -4976,7 +5044,7 @@
 
 
 echo $ac_n "checking if you want fallback-support for box characters""... $ac_c" 1>&6
-echo "configure:4980: checking if you want fallback-support for box characters" >&5
+echo "configure:5048: checking if you want fallback-support for box characters" >&5
 
 # Check whether --enable-boxchars or --disable-boxchars was given.
 if test "${enable_boxchars+set}" = set; then
@@ -5000,7 +5068,7 @@
 
 
 echo $ac_n "checking if you want support for HP-style function keys""... $ac_c" 1>&6
-echo "configure:5004: checking if you want support for HP-style function keys" >&5
+echo "configure:5072: checking if you want support for HP-style function keys" >&5
 
 # Check whether --enable-hp-fkeys or --disable-hp-fkeys was given.
 if test "${enable_hp_fkeys+set}" = set; then
@@ -5026,7 +5094,7 @@
 fi
 
 echo $ac_n "checking if you want support for SCO-style function keys""... $ac_c" 1>&6
-echo "configure:5030: checking if you want support for SCO-style function keys" >&5
+echo "configure:5098: checking if you want support for SCO-style function keys" >&5
 
 # Check whether --enable-sco-fkeys or --disable-sco-fkeys was given.
 if test "${enable_sco_fkeys+set}" = set; then
@@ -5052,7 +5120,7 @@
 fi
 
 echo $ac_n "checking if you want support for internationalization""... $ac_c" 1>&6
-echo "configure:5056: checking if you want support for internationalization" >&5
+echo "configure:5124: checking if you want support for internationalization" >&5
 
 # Check whether --enable-i18n or --disable-i18n was given.
 if test "${enable_i18n+set}" = set; then
@@ -5078,7 +5146,7 @@
 fi
 
 echo $ac_n "checking if you want support for initial-erase setup""... $ac_c" 1>&6
-echo "configure:5082: checking if you want support for initial-erase setup" >&5
+echo "configure:5150: checking if you want support for initial-erase setup" >&5
 
 # Check whether --enable-initial-erase or --disable-initial-erase was given.
 if test "${enable_initial_erase+set}" = set; then
@@ -5104,7 +5172,7 @@
 fi
 
 echo $ac_n "checking if you want support for input-method""... $ac_c" 1>&6
-echo "configure:5108: checking if you want support for input-method" >&5
+echo "configure:5176: checking if you want support for input-method" >&5
 
 # Check whether --enable-input-method or --disable-input-method was given.
 if test "${enable_input_method+set}" = set; then
@@ -5124,13 +5192,13 @@
 echo "$ac_t""$enable_ximp" 1>&6
 
 echo $ac_n "checking if X libraries support input-method""... $ac_c" 1>&6
-echo "configure:5128: checking if X libraries support input-method" >&5
+echo "configure:5196: checking if X libraries support input-method" >&5
 if eval "test \"`echo '$''{'cf_cv_input_method'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 5134 "configure"
+#line 5202 "configure"
 #include "confdefs.h"
 
 #include <X11/IntrinsicP.h>
@@ -5157,7 +5225,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cf_cv_input_method=yes
 else
@@ -5180,7 +5248,7 @@
 fi
 
 echo $ac_n "checking if you want support for logging""... $ac_c" 1>&6
-echo "configure:5184: checking if you want support for logging" >&5
+echo "configure:5252: checking if you want support for logging" >&5
 
 # Check whether --enable-logging or --disable-logging was given.
 if test "${enable_logging+set}" = set; then
@@ -5204,7 +5272,7 @@
 EOF
 
        echo $ac_n "checking if you want to allow logging via a pipe""... $ac_c" 1>&6
-echo "configure:5208: checking if you want to allow logging via a pipe" >&5
+echo "configure:5276: checking if you want to allow logging via a pipe" >&5
        
 # Check whether --enable-logfile-exec or --disable-logfile-exec was given.
 if test "${enable_logfile_exec+set}" = set; then
@@ -5231,7 +5299,7 @@
 fi
 
 echo $ac_n "checking if you want support for iconify/maximize translations""... $ac_c" 1>&6
-echo "configure:5235: checking if you want support for iconify/maximize translations" >&5
+echo "configure:5303: checking if you want support for iconify/maximize translations" >&5
 
 # Check whether --enable-maximize or --disable-maximize was given.
 if test "${enable_maximize+set}" = set; then
@@ -5255,7 +5323,7 @@
 
 
 echo $ac_n "checking if you want NumLock to override keyboard tables""... $ac_c" 1>&6
-echo "configure:5259: checking if you want NumLock to override keyboard tables" >&5
+echo "configure:5327: checking if you want NumLock to override keyboard tables" >&5
 
 # Check whether --enable-num-lock or --disable-num-lock was given.
 if test "${enable_num_lock+set}" = set; then
@@ -5279,7 +5347,7 @@
 
 
 echo $ac_n "checking if you want support for right-scrollbar""... $ac_c" 1>&6
-echo "configure:5283: checking if you want support for right-scrollbar" >&5
+echo "configure:5351: checking if you want support for right-scrollbar" >&5
 
 # Check whether --enable-rightbar or --disable-rightbar was given.
 if test "${enable_rightbar+set}" = set; then
@@ -5305,7 +5373,7 @@
 fi
 
 echo $ac_n "checking if you want check for redundant name-change""... $ac_c" 1>&6
-echo "configure:5309: checking if you want check for redundant name-change" >&5
+echo "configure:5377: checking if you want check for redundant name-change" >&5
 
 # Check whether --enable-samename or --disable-samename was given.
 if test "${enable_samename+set}" = set; then
@@ -5329,7 +5397,7 @@
 
 
 echo $ac_n "checking if you want support for tek4014""... $ac_c" 1>&6
-echo "configure:5333: checking if you want support for tek4014" >&5
+echo "configure:5401: checking if you want support for tek4014" >&5
 
 # Check whether --enable-tek4014 or --disable-tek4014 was given.
 if test "${enable_tek4014+set}" = set; then
@@ -5359,7 +5427,7 @@
 fi
 
 echo $ac_n "checking if you want pulldown menus with a toolbar""... $ac_c" 1>&6
-echo "configure:5363: checking if you want pulldown menus with a toolbar" >&5
+echo "configure:5431: checking if you want pulldown menus with a toolbar" >&5
 
 # Check whether --enable-toolbar or --disable-toolbar was given.
 if test "${enable_toolbar+set}" = set; then
@@ -5383,7 +5451,7 @@
 
 
 echo $ac_n "checking if you want VT52 emulation""... $ac_c" 1>&6
-echo "configure:5387: checking if you want VT52 emulation" >&5
+echo "configure:5455: checking if you want VT52 emulation" >&5
 
 # Check whether --enable-vt52 or --disable-vt52 was given.
 if test "${enable_vt52+set}" = set; then
@@ -5407,7 +5475,7 @@
 
 
 echo $ac_n "checking if you want wide-character support""... $ac_c" 1>&6
-echo "configure:5411: checking if you want wide-character support" >&5
+echo "configure:5479: checking if you want wide-character support" >&5
 
 # Check whether --enable-wide-chars or --disable-wide-chars was given.
 if test "${enable_wide_chars+set}" = set; then
@@ -5436,7 +5504,7 @@
 fi
 
 echo $ac_n "checking if you want DECterm Locator support""... $ac_c" 1>&6
-echo "configure:5440: checking if you want DECterm Locator support" >&5
+echo "configure:5508: checking if you want DECterm Locator support" >&5
 
 # Check whether --enable-dec-locator or --disable-dec-locator was given.
 if test "${enable_dec_locator+set}" = set; then
@@ -5462,7 +5530,7 @@
 fi
 
 echo $ac_n "checking if you want -ziconbeep option""... $ac_c" 1>&6
-echo "configure:5466: checking if you want -ziconbeep option" >&5
+echo "configure:5534: checking if you want -ziconbeep option" >&5
 
 # Check whether --enable-ziconbeep or --disable-ziconbeep was given.
 if test "${enable_ziconbeep+set}" = set; then
@@ -5487,7 +5555,7 @@
 
 # development/testing aids
 echo $ac_n "checking if you want debugging traces""... $ac_c" 1>&6
-echo "configure:5491: checking if you want debugging traces" >&5
+echo "configure:5559: checking if you want debugging traces" >&5
 
 # Check whether --enable-trace or --disable-trace was given.
 if test "${enable_trace+set}" = set; then
@@ -5516,7 +5584,7 @@
 
 
 echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
-echo "configure:5520: checking if you want to see long compiling messages" >&5
+echo "configure:5588: checking if you want to see long compiling messages" >&5
 
 # Check whether --enable-echo or --disable-echo was given.
 if test "${enable_echo+set}" = set; then
@@ -5556,7 +5624,7 @@
 
 
 echo $ac_n "checking if you want magic cookie emulation""... $ac_c" 1>&6
-echo "configure:5560: checking if you want magic cookie emulation" >&5
+echo "configure:5628: checking if you want magic cookie emulation" >&5
 
 # Check whether --enable-xmc-glitch or --disable-xmc-glitch was given.
 if test "${enable_xmc_glitch+set}" = set; then
@@ -5585,7 +5653,7 @@
 
 if test -n "$GCC" ; then
 echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
-echo "configure:5589: checking if you want to turn on gcc warnings" >&5
+echo "configure:5657: checking if you want to turn on gcc warnings" >&5
 
 # Check whether --enable-warnings or --disable-warnings was given.
 if test "${enable_warnings+set}" = set; then
@@ -5625,9 +5693,9 @@
 if test -n "$GCC"
 then
        echo "checking for $CC __attribute__ directives" 1>&6
-echo "configure:5629: checking for $CC __attribute__ directives" >&5
+echo "configure:5697: checking for $CC __attribute__ directives" >&5
        cat > conftest.$ac_ext <<EOF
-#line 5631 "configure"
+#line 5699 "configure"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -5665,7 +5733,7 @@
 EOF
                        ;;
                esac
-               if { (eval echo configure:5669: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+               if { (eval echo configure:5737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
                        test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
                        cat conftest.h >>confdefs.h
 #              else
@@ -5682,11 +5750,11 @@
 if test -n "$GCC"
 then
                cat > conftest.$ac_ext <<EOF
-#line 5686 "configure"
+#line 5754 "configure"
 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
 EOF
                echo "checking for $CC warning options" 1>&6
-echo "configure:5690: checking for $CC warning options" >&5
+echo "configure:5758: checking for $CC warning options" >&5
        cf_save_CFLAGS="$CFLAGS"
        EXTRA_CFLAGS="-W -Wall"
        cf_warn_CONST=""
@@ -5704,7 +5772,7 @@
                Wstrict-prototypes $cf_warn_CONST
        do
                CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-               if { (eval echo configure:5708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+               if { (eval echo configure:5776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
                        test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
                        EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
                        test "$cf_opt" = Wcast-qual && EXTRA_CFLAGS="$EXTRA_CFLAGS -DXTSTRINGDEFINES"
Index: ctlseqs.ms
--- xterm-131+/ctlseqs.ms       Tue Feb 29 20:45:52 2000
+++ xterm-132/ctlseqs.ms        Sat Mar  4 04:36:01 2000
@@ -1,7 +1,7 @@
 .\"#! troff -ms $1             -*- Nroff -*-
 .\" "Xterm Control Sequences" document
 .\" $XConsortium: ctlseqs.ms,v 1.16 94/12/28 20:45:48 gildea Exp $
-.\" $XFree86: xc/doc/specs/xterm/ctlseqs.ms,v 3.35 2000/02/13 00:56:01 dawes Exp $
+.\" $XFree86: xc/doc/specs/xterm/ctlseqs.ms,v 3.36 2000/03/03 20:02:05 dawes Exp $
 .\"
 .\"
 .\" Copyright 1996,1997,1998,1999,2000 by Thomas E. Dickey <dickey@clark.net>
Index: input.c
--- xterm-131+/input.c  Fri Apr  7 02:44:10 2000
+++ xterm-132/input.c   Mon Apr 10 21:52:51 2000
@@ -574,7 +574,7 @@
                if (term->keyboard.type == keyboardIsVT220) {
                        if ((event->state & ControlMask)
                         && (keysym >= XK_F1 && keysym <= XK_F12))
-                               keysym += 12;
+                               keysym += term->misc.ctrl_fkeys;
                }
 #endif
 
Index: main.c
--- xterm-131+/main.c   Fri Apr  7 02:44:10 2000
+++ xterm-132/main.c    Tue Apr 11 06:08:19 2000
@@ -133,6 +133,7 @@
 
 #ifdef __osf__
 #define USE_SYSV_SIGNALS
+#define WTMP
 #endif
 
 #ifdef SVR4
@@ -225,6 +226,10 @@
 #include <grp.h>
 #endif
 
+#ifndef TTY_GROUP_NAME
+#define TTY_GROUP_NAME "tty"
+#endif
+
 #ifndef __CYGWIN__
 #include <sys/ioctl.h>
 #endif
@@ -2875,7 +2880,7 @@
 #ifdef USE_TTY_GROUP
        {
                struct group *ttygrp;
-               if ((ttygrp = getgrnam("tty")) != 0) {
+               if ((ttygrp = getgrnam(TTY_GROUP_NAME)) != 0) {
                        /* change ownership of tty to real uid, "tty" gid */
                        set_owner (ttydev, screen->uid, ttygrp->gr_gid,
                                   (resource.messages? 0620 : 0600));
@@ -3327,7 +3332,7 @@
                (void) setutent ();
                /* set up entry to search for */
                ptyname = ttydev;
-               bzero(&utmp, sizeof(utmp));
+               bzero((char *)&utmp, sizeof(utmp));
 #ifndef __sgi
                if (PTYCHARLEN >= (int)strlen(ptyname))
                    ptynameptr = ptyname;
@@ -3341,7 +3346,13 @@
                utmp.ut_type = DEAD_PROCESS;
 
                /* position to entry in utmp file */
-               (void) getutid(&utmp);
+               /* Test return value: beware of entries left behind: PSz 9 Mar 00 */
+               if (! getutid(&utmp)) {
+                   utmp.ut_type = USER_PROCESS;
+                   if (! getutid(&utmp)) {
+                       (void) setutent();
+                   }
+               }
 
                /* set up the new entry */
                utmp.ut_type = USER_PROCESS;
@@ -3396,7 +3407,7 @@
 #else
                if (term->misc.login_shell &&
                     (i = open(etc_wtmp, O_WRONLY|O_APPEND)) >= 0) {
-                   write(i, (char *)&utmp, sizeof(struct utmp));
+                   write(i, (char *)&utmp, sizeof(utmp));
                    close(i);
                }
 #endif
@@ -3413,7 +3424,7 @@
                {
                        if (pw && !resource.utmpInhibit &&
                            (i = open(etc_utmp, O_WRONLY)) >= 0) {
-                               bzero((char *)&utmp, sizeof(struct utmp));
+                               bzero((char *)&utmp, sizeof(utmp));
                                (void) strncpy(utmp.ut_line,
                                               ttydev + strlen("/dev/"),
                                               sizeof(utmp.ut_line));
@@ -3430,8 +3441,8 @@
 #endif
                                /* cast needed on Ultrix 4.4 */
                                time((time_t*)&utmp.ut_time);
-                               lseek(i, (long)(tslot * sizeof(struct utmp)), 0);
-                               write(i, (char *)&utmp, sizeof(struct utmp));
+                               lseek(i, (long)(tslot * sizeof(utmp)), 0);
+                               write(i, (char *)&utmp, sizeof(utmp));
                                close(i);
                                added_utmp_entry = True;
 #if defined(WTMP)
@@ -3439,16 +3450,15 @@
                                (i = open(etc_wtmp, O_WRONLY|O_APPEND)) >= 0) {
                                    int status;
                                    status = write(i, (char *)&utmp,
-                                                  sizeof(struct utmp));
+                                                  sizeof(utmp));
                                    status = close(i);
                                }
 #elif defined(MNX_LASTLOG)
                                if (term->misc.login_shell &&
                                (i = open(_U_LASTLOG, O_WRONLY)) >= 0) {
                                    lseek(i, (long)(screen->uid *
-                                       sizeof (struct utmp)), 0);
-                                   write(i, (char *)&utmp,
-                                       sizeof (struct utmp));
+                                       sizeof (utmp)), 0);
+                                   write(i, (char *)&utmp, sizeof (utmp));
                                    close(i);
                                }
 #endif /* WTMP or MNX_LASTLOG */
@@ -3465,23 +3475,22 @@
 #endif /* USE_SYSV_UTMP */
 
 #ifdef USE_LASTLOG
-                               if (term->misc.login_shell &&
-                               (i = open(etc_lastlog, O_WRONLY)) >= 0) {
-                                   bzero((char *)&lastlog,
-                                       sizeof (struct lastlog));
-                                   (void) strncpy(lastlog.ll_line, ttydev +
-                                       sizeof("/dev"),
-                                       sizeof (lastlog.ll_line));
-                                   (void) strncpy(lastlog.ll_host,
-                                         XDisplayString (screen->display),
-                                         sizeof (lastlog.ll_host));
-                                   time(&lastlog.ll_time);
-                                   lseek(i, (long)(screen->uid *
-                                       sizeof (struct lastlog)), 0);
-                                   write(i, (char *)&lastlog,
-                                       sizeof (struct lastlog));
-                                   close(i);
-                               }
+               if (term->misc.login_shell &&
+               (i = open(etc_lastlog, O_WRONLY)) >= 0) {
+                   bzero((char *)&lastlog, sizeof (struct lastlog));
+                   (void) strncpy(lastlog.ll_line, ttydev +
+                       sizeof("/dev"),
+                       sizeof (lastlog.ll_line));
+                   (void) strncpy(lastlog.ll_host,
+                         XDisplayString (screen->display),
+                         sizeof (lastlog.ll_host));
+                   time(&lastlog.ll_time);
+                   lseek(i, (long)(screen->uid *
+                       sizeof (struct lastlog)), 0);
+                   write(i, (char *)&lastlog,
+                       sizeof (struct lastlog));
+                   close(i);
+               }
 #endif /* USE_LASTLOG */
 
 #ifdef USE_HANDSHAKE
@@ -3497,10 +3506,22 @@
 
                (void) setgid (screen->gid);
 #ifdef HAS_BSD_GROUPS
-               if (geteuid() == 0 && pw)
-                 initgroups (pw->pw_name, pw->pw_gid);
+               if (geteuid() == 0 && pw) {
+                   if (initgroups (pw->pw_name, pw->pw_gid)) {
+                       perror( "initgroups failed" );
+                       exit (errno);
+                   }
+               }
 #endif
-               (void) setuid (screen->uid);
+               if (setuid (screen->uid)) {
+                       perror( "setuid failed" );
+                       exit (errno);
+               }
+               /* A bit of paranoia: PSz 9 Mar 00 */
+               if (screen->uid && ! setuid(0)) {
+                       fprintf (stderr, "can still get back to root\n");
+                       exit (EACCES);
+               }
 
 #ifdef USE_HANDSHAKE
                /* mark the pipes as close on exec */
@@ -4224,9 +4245,9 @@
 
        if (!resource.utmpInhibit && added_utmp_entry &&
            (!am_slave && tslot > 0 && (wfd = open(etc_utmp, O_WRONLY)) >= 0)){
-               bzero((char *)&utmp, sizeof(struct utmp));
-               lseek(wfd, (long)(tslot * sizeof(struct utmp)), 0);
-               write(wfd, (char *)&utmp, sizeof(struct utmp));
+               bzero((char *)&utmp, sizeof(utmp));
+               lseek(wfd, (long)(tslot * sizeof(utmp)), 0);
+               write(wfd, (char *)&utmp, sizeof(utmp));
                close(wfd);
 #ifdef WTMP
                if (term->misc.login_shell &&
@@ -4235,7 +4256,7 @@
                        (void) strncpy(utmp.ut_line, ttydev +
                            sizeof("/dev"), sizeof (utmp.ut_line));
                        time(&utmp.ut_time);
-                       i = write(wfd, (char *)&utmp, sizeof(struct utmp));
+                       i = write(wfd, (char *)&utmp, sizeof(utmp));
                        i = close(wfd);
                }
 #endif /* WTMP */
Index: mkdirs.sh
--- xterm-131+/mkdirs.sh        Mon Sep 27 16:12:18 1999
+++ xterm-132/mkdirs.sh Tue Nov 30 22:38:43 1999
@@ -5,7 +5,6 @@
 # Last modified: 1994-03-25
 # Public domain
 #
-# $XFree86: xc/programs/xterm/mkdirs.sh,v 3.5 1999/09/27 14:59:29 dawes Exp $
 
 errstatus=0
 umask 022
@@ -23,7 +22,10 @@
 
      if test ! -d "$pathcomp"; then
         echo "mkdir $pathcomp" 1>&2
-        mkdir "$pathcomp" || errstatus=$?
+        case "$pathcomp" in
+          [a-zA-Z]: )  ;;               # DOSISH systems
+          * )          mkdir "$pathcomp" || errstatus=$? ;;
+        esac
      fi
 
      pathcomp="$pathcomp/"
Index: ptyx.h
--- xterm-131+/ptyx.h   Sat Mar  4 04:36:01 2000
+++ xterm-132/ptyx.h    Mon Apr 10 21:52:29 2000
@@ -1214,6 +1214,9 @@
 #if OPT_SHIFT_KEYS
     Boolean shift_keys;                /* true if we interpret shifted special-keys */
 #endif
+#if OPT_SUNPC_KBD
+    int ctrl_fkeys;            /* amount to add to XK_F1 for ctrl modifier */
+#endif
 #if OPT_NUM_LOCK
     Boolean real_NumLock;      /* true if we treat NumLock key specially */
     unsigned long num_lock;    /* modifier for Num_Lock */
Index: resize.c
--- xterm-131+/resize.c Fri Apr  7 02:44:10 2000
+++ xterm-132/resize.c  Sun Apr  9 17:55:15 2000
@@ -80,6 +80,10 @@
 #define USE_TERMIOS
 #endif
 
+#ifdef __MVS__
+#define USE_TERMIOS
+#endif
+
 #ifdef Lynx
 #define USE_SYSV_TERMIO
 #endif
@@ -180,6 +184,12 @@
 #define GCC_UNUSED /* nothing */
 #endif
 
+#ifdef __MVS__
+#define ESC(string) "\047" string
+#else
+#define ESC(string) "\033" string
+#endif
+
 #define        EMULATIONS      2
 #define        SUN             1
 #define        VT100           0
@@ -211,25 +221,25 @@
 char *myname;
 int shell_type = SHELL_UNKNOWN;
 char *getsize[EMULATIONS] = {
-       "\0337\033[r\033[999;999H\033[6n",
-       "\033[18t",
+       ESC("7") ESC("[r") ESC("[999;999H") ESC("[6n"),
+       ESC("[18t"),
 };
 #if !defined(sun) || defined(SVR4)
 #ifdef TIOCSWINSZ
 char *getwsize[EMULATIONS] = { /* size in pixels */
        0,
-       "\033[14t",
+       ESC("[14t"),
 };
 #endif /* TIOCSWINSZ */
 #endif /* sun */
 char *restore[EMULATIONS] = {
-       "\0338",
+       ESC("8"),
        0,
 };
 char *setname = "";
 char *setsize[EMULATIONS] = {
        0,
-       "\033[8;%s;%st",
+       ESC("[8;%s;%st"),
 };
 #ifdef USE_SYSV_TERMIO
 struct termio tioorig;
@@ -241,8 +251,8 @@
 # endif /* USE_TERMIOS */
 #endif /* USE_SYSV_TERMIO */
 char *size[EMULATIONS] = {
-       "\033[%d;%dR",
-       "\033[8;%d;%dt",
+       ESC("[%d;%dR"),
+       ESC("[8;%d;%dt"),
 };
 char sunname[] = "sunsize";
 int tty;
@@ -251,7 +261,7 @@
 #ifdef TIOCSWINSZ
 char *wsize[EMULATIONS] = {
        0,
-       "\033[4;%hd;%hdt",
+       ESC("[4;%hd;%hdt"),
 };
 #endif /* TIOCSWINSZ */
 #endif /* sun */
@@ -626,10 +636,11 @@
        setitimer(ITIMER_REAL, &it, (struct itimerval *)NULL);
 #endif
        if ((c = getc(fp)) == 0233) {   /* meta-escape, CSI */
-               *buf++ = c = '\033';
+               *buf++ = c = ESC("")[0];
                *buf++ = '[';
-       } else
+       } else {
                *buf++ = c;
+       }
        if(c != *str) {
                fprintf(stderr, "%s: unknown character, exiting.\r\n", myname);
                onintr(0);
Index: scrollbar.c
--- xterm-131+/scrollbar.c      Sat Mar  4 04:36:01 2000
+++ xterm-132/scrollbar.c       Sun Apr  9 15:50:33 2000
@@ -288,7 +288,7 @@
                screen->scrollWidget,
 #ifdef SCROLLBAR_RIGHT
                (term->misc.useRight)
-                       ? (term->core.width -
+                       ? (screen->fullVwin.fullwidth -
                           screen->scrollWidget->core.width -
                           screen->scrollWidget->core.border_width)
                        : -1,
Index: version.h
--- xterm-131+/version.h        Fri Apr  7 02:44:10 2000
+++ xterm-132/version.h Mon Apr 10 20:49:07 2000
@@ -6,5 +6,5 @@
  * XFree86 to which this version of xterm has been built.  The number in
  * parentheses is my patch number (T.Dickey).
  */
-#define XTERM_PATCH   131
-#define XFREE86_VERSION "XFree86 4.0"
+#define XTERM_PATCH   132
+#define XFREE86_VERSION "XFree86 4.0a"
Index: xterm.h
--- xterm-131+/xterm.h  Fri Apr  7 02:44:10 2000
+++ xterm-132/xterm.h   Tue Apr 11 06:17:35 2000
@@ -119,10 +119,14 @@
 #define USE_SYSV_UTMP
 #endif
 
-#if defined(__GNU__) || defined(__MVS__)
+#if defined(__GNU__) || defined(__MVS__) || defined(__osf__)
 #define USE_TTY_GROUP
 #endif
 
+#ifdef __osf__
+#define TTY_GROUP_NAME "terminal"
+#endif
+
 #if defined(__MVS__)
 #undef ut_xstatus
 #define ut_name ut_user
@@ -177,6 +181,7 @@
 
 #if (XtSpecificationRelease >= 6) && !defined(NO_XPOLL_H)
 #include <X11/Xpoll.h>
+#define USE_XPOLL_H 1
 #else
 #define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval *)t)
 #define XFD_COPYSET(src,dst) bcopy((src)->fds_bits, (dst)->fds_bits, sizeof(fd_set))
@@ -189,7 +194,7 @@
 
 #include <sys/types.h>
 
-#if defined(AIXV3) && defined(NFDBITS)
+#if defined(USE_XPOLL_H) && defined(AIXV3) && defined(NFDBITS)
 #undef NFDBITS /* conflict between X11/Xpoll.h and sys/select.h */
 #endif
 
@@ -240,6 +245,7 @@
 #define XtNcolorMode           "colorMode"
 #define XtNcolorUL             "colorUL"
 #define XtNcolorULMode         "colorULMode"
+#define XtNctrlFKeys           "ctrlFKeys"
 #define XtNcurses              "curses"
 #define XtNcursorBlink         "cursorBlink"
 #define XtNcursorColor         "cursorColor"
@@ -324,6 +330,7 @@
 #define XtCCharClass           "CharClass"
 #define XtCColorMode           "ColorMode"
 #define XtCColumn              "Column"
+#define XtCCtrlFKeys           "CtrlFKeys"
 #define XtCCurses              "Curses"
 #define XtCCursorBlink         "CursorBlink"
 #define XtCCursorOffTime       "CursorOffTime"
Index: xterm.log.html
--- xterm-131+/xterm.log.html   Fri Apr  7 02:44:10 2000
+++ xterm-132/xterm.log.html    Tue Apr 11 06:21:07 2000
@@ -41,6 +41,7 @@
 xc/programs/Xserver/hw/xfree86).
 
 <UL>
+<LI><A HREF="#xterm_132">Patch #132 - 2000/4/11 - XFree86 4.0a</A>
 <LI><A HREF="#xterm_131">Patch #131 - 2000/3/3 - XFree86 3.9.18b</A>
 <LI><A HREF="#xterm_130">Patch #130 - 2000/3/1 - XFree86 3.9.18a</A>
 <LI><A HREF="#xterm_129">Patch #129 - 2000/2/26 - XFree86 3.9.18a</A>
@@ -174,6 +175,38 @@
 <LI><A HREF="#xterm_02">Patch #2 - 1996/1/7</A>
 <LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
 </UL>
+
+<H1><A NAME="xterm_132">Patch #132 - 2000/4/11 - XFree86 4.0a</A></H1>
+<ul>
+       <li>undo an incorrect change from patch #113 caused the right scrollbar
+         to be positioned incorrectly when re-enabling it (analysis by
+         D Roland Walker).
+
+       <li>add ctrlFKeys resource, replacing constant for adjusting
+         control-F1 to control-F12 to VT220-style F10-F20.  The resource
+         changes the constant 12 to a default value of 10 (request by
+         Jim Knoble &lt;jmknoble@pobox.com&gt;).
+
+       <li>correct ifdef'ing for conflict between definitions in AIX's
+         &lt;sys/select.h&gt; and &lt;X11/XPoll.h&gt; (reported by Clint
+         Olsen).
+
+       <li>add checks for return-values of getutid(), initgroups() and
+         setuid() in main.c, as well as modifying ifdef's for __osf__ to
+         include tty-group and WTMP logic (adapted from patch by Paul Szabo
+         &lt;psz@maths.usyd.edu.au&gt;)
+
+       <li>modify resize.c to build and work on os390 (uses EBCDIC)
+         (adapted from patch by Phil Sidler &lt;Phil.Sidler@airborne.com&gt;)
+
+       <li>use Ires(), Bres() and Sres() macros to simplify resource list in
+         charproc.c
+
+       <li>resync with XFree86 4.0a:
+       <ul>
+         <li>correct a typo in os2main.c (Holger Veit, from 4.0a).
+       </ul>
+</ul>
 
 <H1><A NAME="xterm_131">Patch #131 - 2000/3/3 - XFree86 3.9.18b</A></H1>
 <ul>
Index: xterm.man
--- xterm-131+/xterm.man        Sat Mar  4 04:36:01 2000
+++ xterm-132/xterm.man Mon Apr 10 22:15:39 2000
@@ -124,7 +124,7 @@
 menu; see below).
 The name of the file will be
 ``\fBCOPY\fIyyyy\fB\-\fIMM\fB\-\fIdd\fB.\fIhh\fB:\fImm\fB:\fIss\fP'', where
-.IR yy ,
+.IR yyyy ,
 .IR MM ,
 .IR dd ,
 .IR hh ,
@@ -783,7 +783,8 @@
 than DEC VT220.
 This causes the keypad `+' to be mapped to `,'.
 and
-CTRL-F1 to F13, CTRL-F2 to F14, etc.,
+CTRL F1-F12 to F11-F20, depending on the setting of the \fBctrlFKeys\fP
+resource.
 so \fIxterm\fP emulates a DEC VT220 more accurately.
 Otherwise (the default, with \fBsunKeyboard\fP set to ``false''),
 \fIxterm\fP uses PC-style bindings for the function keys and keypad.
@@ -1051,6 +1052,13 @@
 .B "colorUL (\fPclass\fB Foreground)"
 This specifies the color to use to display underlined characters if
 the ``colorULMode'' resource is enabled.
+.TP 8
+.B "ctrlFKeys (\fPclass\fB CtrlFKeys)"
+In VT220 keyboard mode (see \fBsunKeyboard\fP resource),
+specifies the amount by which to shift F1-F12 given a control modifier (CTRL).
+This allows you to generate key symbols for F10-F20 on a Sun/PC keyboard.
+The default is ``10'', which means that CTRL F1 generates the key
+symbol for F11.
 .TP 8
 .B "cursorBlink (\fPclass\fB CursorBlink)"
 Specifies whether to make the cursor blink.
Index: xtermcfg.hin
--- xterm-131+/xtermcfg.hin     Sat Mar  4 04:36:01 2000
+++ xterm-132/xtermcfg.hin      Tue Apr 11 06:04:50 2000
@@ -84,6 +84,7 @@
 #undef OPT_ZICONBEEP           /* CF_ARG_DISABLE(ziconbeep) */
 #undef OWN_TERMINFO_DIR                /* AC_ARG_WITH(own-terminfo) */
 #undef SCROLLBAR_RIGHT         /* CF_ARG_ENABLE(rightbar) */
+#undef TTY_GROUP_NAME          /* CF_TTY_GROUP */
 #undef USE_LASTLOG             /* CF_LASTLOG */
 #undef USE_MY_MEMMOVE          /* CF_FUNC_MEMMOVE */
 #undef USE_OK_BCOPY            /* CF_FUNC_MEMMOVE */
@@ -96,10 +97,10 @@
 #undef UTMPX_FOR_UTMP          /* CF_UTMP */
 #undef const                   /* AC_CONST */
 #undef size_t                  /* AC_TYPE_SIZE_T */
+#undef time_t                  /* AC_CHECK_TYPE(time_t, long) */
 #undef ut_name                 /* CF_UTMP */
 #undef ut_xstatus              /* CF_UTMP_UT_XSTATUS */
 #undef ut_xtime                        /* CF_UTMP_UT_XTIME */
-#undef time_t                  /* AC_CHECK_TYPE(time_t, long) */
 
 #undef GCC_PRINTF
 #undef GCC_UNUSED