# This patch applies to cxterm-11.5.1 # # It does the following: # 1. fixes the bugs that caused HZINPUTDIR to hold only one path. # 2. fixes the bug that disable repetitions in non-multiple choice. # 3. tries to open "fixed" font in case there is no "8x16". # 4. applied MIT X11R5 fix-09, fix-10, and fix-11 on xterm, which fix # the following problems: # - orphaned shells on AIX if connection is lost # - support SGI ptys (of IRIX 4.0) # - fails to update menu when keyboard grab is forcibly deactivated # - ESC seq not updating App Cursor Keys menu # - restore ESC seq not updating Margin Bell menu # - use of getchar fails on some systems # - keyboard grabbing does not work consistently # 5. makes the code more "POSIX". # # To apply: # % cd src/cxterm # or the cxterm source directory # % patch -p < cxterm-11.5.1.patch01 # # PS: "patch" is a useful tool that comes with MIT X11. Get it from # export.lcs.mit.edu if you don't have "patch" in your system. # *** /tmp/cxterm/version Sat Oct 26 23:48:18 1991 --- version Mon Jul 13 03:20:36 1992 *************** *** 1 **** --- 1,2 ---- + CXTERM 11.5.1 X11R5 revision 1 patch level 1 Jul/13/1992 CXTERM 11.5.1 X11R5 revision 1 patch level 0 Oct/26/1991 *** /tmp/cxterm/cxterm/Imakefile Tue Oct 1 00:04:53 1991 --- cxterm/Imakefile Sat Mar 21 17:44:52 1992 *************** *** 1,5 **** ! XCOMM $Id: Imakefile,v 1.4 1991/10/01 05:04:49 ygz Exp $ ! XCOMM $XConsortium: Imakefile,v 1.55 91/09/22 11:40:47 rws Exp $ XCOMM XCOMM Attention xterm porters XCOMM --- 1,5 ---- ! XCOMM $Id: Imakefile,v 1.5 1992/03/21 22:44:15 ygz Exp $ ! XCOMM $XConsortium: Imakefile,v 1.56 92/03/11 17:35:22 gildea Exp $ XCOMM XCOMM Attention xterm porters XCOMM *************** *** 22,28 **** #endif DEFINES = -DHANZI ! MAIN_DEFINES = -DUTMP $(TTYGROUPDEF) $(PUCCPTYDDEF) MISC_DEFINES = /* -DALLOWLOGFILEEXEC */ SRCS1 = button.c charproc.c cursor.c data.c input.c \ --- 22,34 ---- #endif DEFINES = -DHANZI ! ! OSMAJORVERSION = OSMajorVersion ! OSMINORVERSION = OSMinorVersion ! ! MAIN_DEFINES = -DUTMP $(TTYGROUPDEF) $(PUCCPTYDDEF) \ ! -DOSMAJORVERSION=$(OSMAJORVERSION) \ ! -DOSMINORVERSION=$(OSMINORVERSION) MISC_DEFINES = /* -DALLOWLOGFILEEXEC */ SRCS1 = button.c charproc.c cursor.c data.c input.c \ *** /tmp/cxterm/cxterm/main.c Mon Sep 30 23:55:41 1991 --- cxterm/main.c Sat Mar 21 17:44:50 1992 *************** *** 1,6 **** #ifndef lint ! static char *cxterm_rid="$id"; ! static char *rid="$XConsortium: main.c,v 1.195 91/07/22 12:23:31 gildea Exp $"; #endif /* lint */ /* --- 1,6 ---- #ifndef lint ! static char *cxterm_rid="$Id: main.c,v 1.5 1992/03/21 22:44:15 ygz Exp $"; ! static char *rid="$XConsortium: main.c,v 1.200 92/03/11 17:36:12 gildea Exp $"; #endif /* lint */ /* *************** *** 17,23 **** */ /*********************************************************************** ! * Copyright 1990, 1991 by Yongguang Zhang and Pong Man-Chi. * * All rights reserved, under the same copyright and permission term as * the original. Absolutely no warranties of any kinds. --- 17,23 ---- */ /*********************************************************************** ! * Copyright 1990, 1991, 1992 by Yongguang Zhang and Pong Man-Chi. * * All rights reserved, under the same copyright and permission term as * the original. Absolutely no warranties of any kinds. *************** *** 777,783 **** register TScreen *screen; register int i, pty; int Xsocket, mode; ! char *basename(); int xerror(), xioerror(); ProgramName = argv[0]; --- 777,783 ---- register TScreen *screen; register int i, pty; int Xsocket, mode; ! char *base_name(); int xerror(), xioerror(); ProgramName = argv[0]; *************** *** 1070,1076 **** if (!resource.title) { if (command_to_exec) { ! resource.title = basename (command_to_exec[0]); } /* else not reached */ } --- 1070,1076 ---- if (!resource.title) { if (command_to_exec) { ! resource.title = base_name (command_to_exec[0]); } /* else not reached */ } *************** *** 1145,1150 **** --- 1145,1168 ---- } screen->inhibit = inhibit; + #ifdef AIXV3 + /* In AIXV3, xterms started from /dev/console have CLOCAL set. + * This means we need to clear CLOCAL so that SIGHUP gets sent + * to the slave-pty process when xterm exits. + */ + + { + struct termio tio; + + if(ioctl(pty, TCGETA, &tio) == -1) + SysError(ERROR_TIOCGETP); + + tio.c_cflag &= ~(CLOCAL); + + if (ioctl (pty, TCSETA, &tio) == -1) + SysError(ERROR_TIOCSETP); + } + #endif #ifdef USE_SYSV_TERMIO if (0 > (mode = fcntl(pty, F_GETFL, 0))) Error(); *************** *** 1178,1184 **** } } ! char *basename(name) char *name; { register char *cp; --- 1196,1202 ---- } } ! char *base_name(name) char *name; { register char *cp; *************** *** 1236,1241 **** --- 1254,1277 ---- #endif return 0; #else /* ATT else */ + #ifdef AIXV3 + if ((*pty = open ("/dev/ptc", O_RDWR)) < 0) { + return 1; + } + strcpy(ttydev, ttyname(*pty)); + return 0; + #endif + #if defined(sgi) && OSMAJORVERSION >= 4 + { + char *tty_name; + + tty_name = _getpty (pty, O_RDWR, 0622, 0); + if (tty_name == 0) + return 1; + strcpy (ttydev, tty_name); + return 0; + } + #endif #ifdef __convex__ { char *pty_name, *getpty(); *************** *** 1254,1260 **** #ifdef USE_GET_PSEUDOTTY return ((*pty = getpseudotty (&ttydev, &ptydev)) >= 0 ? 0 : 1); #else ! #if defined(sgi) || (defined(umips) && defined (SYSTYPE_SYSV)) struct stat fstat_buf; *pty = open ("/dev/ptc", O_RDWR); --- 1290,1296 ---- #ifdef USE_GET_PSEUDOTTY return ((*pty = getpseudotty (&ttydev, &ptydev)) >= 0 ? 0 : 1); #else ! #if (defined(sgi) && OSMAJORVERSION < 4) || (defined(umips) && defined (SYSTYPE_SYSV)) struct stat fstat_buf; *pty = open ("/dev/ptc", O_RDWR); *************** *** 1589,1596 **** if (tty_got_hung || errno == ENXIO || errno == EIO || errno == ENOTTY) { no_dev_tty = TRUE; - #ifdef USE_SYSV_TERMIO - tio = d_tio; #ifdef TIOCSLTC ltc = d_ltc; #endif /* TIOCSLTC */ --- 1625,1630 ---- *************** *** 1597,1611 **** #ifdef TIOCLSET lmode = d_lmode; #endif /* TIOCLSET */ #else /* not USE_SYSV_TERMIO */ sg = d_sg; tc = d_tc; discipline = d_disipline; - ltc = d_ltc; - lmode = d_lmode; #ifdef sony - jtc = d_jtc; jmode = d_jmode; #endif /* sony */ #endif /* USE_SYSV_TERMIO */ } else { --- 1631,1645 ---- #ifdef TIOCLSET lmode = d_lmode; #endif /* TIOCLSET */ + #ifdef USE_SYSV_TERMIO + tio = d_tio; #else /* not USE_SYSV_TERMIO */ sg = d_sg; tc = d_tc; discipline = d_disipline; #ifdef sony jmode = d_jmode; + jtc = d_jtc; #endif /* sony */ #endif /* USE_SYSV_TERMIO */ } else { *************** *** 1612,1662 **** SysError(ERROR_OPDEVTTY); } } else { ! /* get a copy of the current terminal's state */ ! ! #ifdef USE_SYSV_TERMIO ! /* SVR4 fails here if xterm started ! from twm from xdm from /etc/rc. ! Hence the protection for the next 3 ioctl's. ! Something about not having a controlling tty. */ ! if(ioctl(tty, TCGETA, &tio) == -1) ! #ifndef SVR4 ! SysError(ERROR_TIOCGETP); ! #else /* SVR4 */ ! tio = d_tio; ! #endif /* SVR4 */ #ifdef TIOCSLTC if(ioctl(tty, TIOCGLTC, <c) == -1) - #ifndef SVR4 - SysError(ERROR_TIOCGLTC); - #else /* SVR4 */ ltc = d_ltc; - #endif /* SVR4 */ #endif /* TIOCSLTC */ #ifdef TIOCLSET if(ioctl(tty, TIOCLGET, &lmode) == -1) - #ifndef SVR4 - SysError(ERROR_TIOCLGET); - #else /* SVR4 */ lmode = d_lmode; - #endif /* SVR4 */ #endif /* TIOCLSET */ #else /* not USE_SYSV_TERMIO */ if(ioctl(tty, TIOCGETP, (char *)&sg) == -1) ! SysError (ERROR_TIOCGETP); if(ioctl(tty, TIOCGETC, (char *)&tc) == -1) ! SysError (ERROR_TIOCGETC); if(ioctl(tty, TIOCGETD, (char *)&discipline) == -1) ! SysError (ERROR_TIOCGETD); ! if(ioctl(tty, TIOCGLTC, (char *)<c) == -1) ! SysError (ERROR_TIOCGLTC); ! if(ioctl(tty, TIOCLGET, (char *)&lmode) == -1) ! SysError (ERROR_TIOCLGET); #ifdef sony if(ioctl(tty, TIOCKGET, (char *)&jmode) == -1) ! SysError (ERROR_TIOCKGET); if(ioctl(tty, TIOCKGETC, (char *)&jtc) == -1) ! SysError (ERROR_TIOCKGETC); #endif /* sony */ #endif /* USE_SYSV_TERMIO */ close (tty); --- 1646,1681 ---- SysError(ERROR_OPDEVTTY); } } else { ! /* Get a copy of the current terminal's state, ! * if we can. Some systems (e.g., SVR4 and MacII) ! * may not have a controlling terminal at this point ! * if started directly from xdm or xinit, ! * in which case we just use the defaults as above. ! */ #ifdef TIOCSLTC if(ioctl(tty, TIOCGLTC, <c) == -1) ltc = d_ltc; #endif /* TIOCSLTC */ #ifdef TIOCLSET if(ioctl(tty, TIOCLGET, &lmode) == -1) lmode = d_lmode; #endif /* TIOCLSET */ + #ifdef USE_SYSV_TERMIO + if(ioctl(tty, TCGETA, &tio) == -1) + tio = d_tio; + #else /* not USE_SYSV_TERMIO */ if(ioctl(tty, TIOCGETP, (char *)&sg) == -1) ! sg = d_sg; if(ioctl(tty, TIOCGETC, (char *)&tc) == -1) ! tc = d_tc; if(ioctl(tty, TIOCGETD, (char *)&discipline) == -1) ! discipline = d_disipline; #ifdef sony if(ioctl(tty, TIOCKGET, (char *)&jmode) == -1) ! jmode = d_jmode; if(ioctl(tty, TIOCKGETC, (char *)&jtc) == -1) ! jtc = d_jtc; #endif /* sony */ #endif /* USE_SYSV_TERMIO */ close (tty); *************** *** 2037,2042 **** --- 2056,2066 ---- tio.c_cc[VEOL] = '@' & 0x3f; /* '^@' */ /* certain shells (ksh & csh) change EOF as well */ tio.c_cc[VEOF] = 'D' & 0x3f; /* '^D' */ + #ifdef HANZI + #ifdef LPASS8 + lmode |= LPASS8; + #endif /* LPASS8 */ + #endif /* HANZI */ #define TMODE(ind,var) if (ttymodelist[ind].set) var = ttymodelist[ind].value; if (override_tty_modes) { *** /tmp/cxterm/cxterm/misc.c Mon Sep 30 23:55:43 1991 --- cxterm/misc.c Sat Mar 21 17:44:50 1992 *************** *** 1,12 **** ! /* $Id: misc.c,v 1.2 1991/10/01 04:38:26 ygz Exp $ */ /*********************************************************************** ! * Copyright 1990, 1991 by Yongguang Zhang and Pong Man-Chi. * * All rights reserved. Under the same copyright and permission term as * the original. Absolutely no warranties of any kinds. ************************************************************************/ /* ! * $XConsortium: misc.c,v 1.90 91/07/25 17:59:05 rws Exp $ */ /* --- 1,12 ---- ! /* $Id: misc.c,v 1.3 1992/03/21 22:44:15 ygz Exp $ */ /*********************************************************************** ! * Copyright 1990, 1991, 1992 by Yongguang Zhang and Pong Man-Chi. * * All rights reserved. Under the same copyright and permission term as * the original. Absolutely no warranties of any kinds. ************************************************************************/ /* ! * $XConsortium: misc.c,v 1.92 92/03/13 17:02:08 gildea Exp $ */ /* *************** *** 261,269 **** (event->detail == NotifyPointer) ? INWINDOW : FOCUS); if (screen->grabbedKbd && (event->mode == NotifyUngrab)) { - screen->grabbedKbd = FALSE; - ReverseVideo(term); XBell(screen->display, 100); } } } --- 261,270 ---- (event->detail == NotifyPointer) ? INWINDOW : FOCUS); if (screen->grabbedKbd && (event->mode == NotifyUngrab)) { XBell(screen->display, 100); + ReverseVideo(term); + screen->grabbedKbd = FALSE; + update_securekbd(); } } } *************** *** 577,583 **** cp = screen->TekEmu ? Tbptr : bptr; if((i = cp - screen->logstart) > 0) ! write(screen->logfd, screen->logstart, i); screen->logstart = screen->TekEmu ? Tbuffer : buffer; } --- 578,584 ---- cp = screen->TekEmu ? Tbptr : bptr; if((i = cp - screen->logstart) > 0) ! write(screen->logfd, (char *)screen->logstart, i); screen->logstart = screen->TekEmu ? Tbuffer : buffer; } *** /tmp/cxterm/cxterm/menu.c Tue Jun 25 18:49:44 1991 --- cxterm/menu.c Fri May 8 22:36:01 1992 *************** *** 1,4 **** ! /* $XConsortium: menu.c,v 1.60 91/06/25 19:49:28 gildea Exp $ */ /* Copyright 1989 Massachusetts Institute of Technology --- 1,4 ---- ! /* $XConsortium: menu.c,v 1.61 92/04/20 18:46:39 rws Exp $ */ /* Copyright 1989 Massachusetts Institute of Technology *************** *** 325,331 **** ReverseVideo (term); screen->grabbedKbd = FALSE; } else { ! if (XGrabKeyboard (screen->display, term->core.parent->core.window, True, GrabModeAsync, GrabModeAsync, time) != GrabSuccess) { XBell (screen->display, 100); --- 325,331 ---- ReverseVideo (term); screen->grabbedKbd = FALSE; } else { ! if (XGrabKeyboard (screen->display, term->core.window, True, GrabModeAsync, GrabModeAsync, time) != GrabSuccess) { XBell (screen->display, 100); *** /tmp/cxterm/cxterm/charproc.c Mon Oct 7 14:26:58 1991 --- cxterm/charproc.c Sun Mar 22 00:33:18 1992 *************** *** 1,12 **** ! /* $Id: charproc.c,v 1.4 1991/10/07 19:24:08 ygz Exp $ */ /*********************************************************************** ! * Copyright 1990, 1991 by Yongguang Zhang and Pong Man-Chi. * * All rights reserved. Under the same copyright and permission term as * the original. Absolutely no warranties of any kinds. ************************************************************************/ /* ! * $XConsortium: charproc.c,v 1.173 91/07/22 11:32:49 gildea Exp $ */ /* --- 1,12 ---- ! /* $Id: charproc.c,v 1.6 1992/03/22 05:29:23 ygz Exp $ */ /*********************************************************************** ! * Copyright 1990, 1991, 1992 by Yongguang Zhang and Pong Man-Chi. * * All rights reserved. Under the same copyright and permission term as * the original. Absolutely no warranties of any kinds. ************************************************************************/ /* ! * $XConsortium: charproc.c,v 1.176 92/03/13 18:00:30 gildea Exp $ */ /* *************** *** 1404,1410 **** if (select_mask & pty_mask && eventMode == NORMAL) { if (screen->logging) FlushLog(screen); ! bcnt = read(screen->respond, bptr = buffer, BUF_SIZE); if (bcnt < 0) { if (errno == EIO) Cleanup (0); --- 1404,1410 ---- if (select_mask & pty_mask && eventMode == NORMAL) { if (screen->logging) FlushLog(screen); ! bcnt = read(screen->respond, (char *)(bptr = buffer), BUF_SIZE); if (bcnt < 0) { if (errno == EIO) Cleanup (0); *************** *** 1707,1712 **** --- 1707,1713 ---- switch (param[i]) { case 1: /* DECCKM */ (*func)(&termw->keyboard.flags, CURSOR_APL); + update_appcursor(); break; case 2: /* ANSI/VT52 mode */ if (func == bitset) { *************** *** 1789,1795 **** screen->send_mouse_pos = 0; break; case 38: /* DECTEK */ ! if(func == bitset & !(screen->inhibit & I_TEK)) { if(screen->logging) { FlushLog(screen); screen->logstart = Tbuffer; --- 1790,1796 ---- screen->send_mouse_pos = 0; break; case 38: /* DECTEK */ ! if(func == bitset && !(screen->inhibit & I_TEK)) { if(screen->logging) { FlushLog(screen); screen->logstart = Tbuffer; *************** *** 2017,2023 **** case 44: /* margin bell */ if(!(screen->marginbell = screen->save_modes[12])) screen->bellarmed = -1; ! update_visualbell(); break; case 45: /* reverse wraparound */ termw->flags &= ~REVERSEWRAP; --- 2018,2024 ---- case 44: /* margin bell */ if(!(screen->marginbell = screen->save_modes[12])) screen->bellarmed = -1; ! update_marginbell(); break; case 45: /* reverse wraparound */ termw->flags &= ~REVERSEWRAP; *************** *** 2357,2366 **** } ! static void VTInitialize (request, new) ! XtermWidget request, new; { int i; /* Zero out the entire "screen" component of "new" widget, then do field-by-field assigment of "screen" fields that are named in the resource list. */ --- 2358,2373 ---- } ! /* ARGSUSED */ ! static void VTInitialize (wrequest, wnew, args, num_args) ! Widget wrequest, wnew; ! ArgList args; ! Cardinal *num_args; { + XtermWidget request = (XtermWidget) wrequest; + XtermWidget new = (XtermWidget) wnew; int i; + /* Zero out the entire "screen" component of "new" widget, then do field-by-field assigment of "screen" fields that are named in the resource list. */ *************** *** 2499,2505 **** /* screen->menu_font_names[fontMenu_fontdefault] = "cclib16st"; */ ! } } if (!LoadNewFont(screen, term->misc.f_n, term->misc.f_b, False, 0)) { if (XmuCompareISOLatin1(term->misc.f_n, "8x16") != 0) { --- 2506,2514 ---- /* screen->menu_font_names[fontMenu_fontdefault] = "cclib16st"; */ ! } else ! fprintf (stderr, "%s: unable to open font \"%s\".\n", ! xterm_name, term->misc.f_hn); } if (!LoadNewFont(screen, term->misc.f_n, term->misc.f_b, False, 0)) { if (XmuCompareISOLatin1(term->misc.f_n, "8x16") != 0) { *************** *** 2509,2514 **** --- 2518,2530 ---- (void) LoadNewFont (screen, "8x16", NULL, False, 0); screen->menu_font_names[fontMenu_fontdefault] = "8x16"; } + if (!screen->fnt_norm) { /* it's very messy: no 8x16 font */ + fprintf (stderr, + "%s: unable to open font \"8x16\", %s\n", + xterm_name, "trying the ugly \"fixed\"...."); + (void) LoadNewFont (screen, "fixed", NULL, False, 0); + screen->menu_font_names[fontMenu_fontdefault] = "fixed"; + } } #else /* HANZI */ if (!LoadNewFont(screen, term->misc.f_n, term->misc.f_b, False, 0)) { *************** *** 2525,2531 **** /* really screwed if we couldn't open default font */ #ifdef HANZI if (!screen->hz_fnt_norm) { ! fprintf (stderr, "%s: unable to locate a suitable font\n", xterm_name); Exit (1); } --- 2541,2547 ---- /* really screwed if we couldn't open default font */ #ifdef HANZI if (!screen->hz_fnt_norm) { ! fprintf (stderr, "%s: unable to locate a suitable Chinese font\n", xterm_name); Exit (1); } *************** *** 2660,2666 **** screen->fullVwin.f_height - 1; #endif /* HANZI */ ! screen->sc.row = screen->sc.col = screen->sc.flags = NULL; /* Mark screen buffer as unallocated. We wait until the run loop so that the child process does not fork and exec with all the dynamic --- 2676,2682 ---- screen->fullVwin.f_height - 1; #endif /* HANZI */ ! screen->sc.row = screen->sc.col = screen->sc.flags = 0; /* Mark screen buffer as unallocated. We wait until the run loop so that the child process does not fork and exec with all the dynamic *************** *** 2669,2675 **** if (!tekWidget) /* if not called after fork */ screen->buf = screen->allbuf = NULL; ! screen->do_wrap = NULL; screen->scrolls = screen->incopy = 0; set_vt_box (screen); --- 2685,2691 ---- if (!tekWidget) /* if not called after fork */ screen->buf = screen->allbuf = NULL; ! screen->do_wrap = 0; screen->scrolls = screen->incopy = 0; set_vt_box (screen); *************** *** 3047,3053 **** term->flags &= ~ORIGIN; if(full) { TabReset (term->tabs); ! term->keyboard.flags = NULL; update_appcursor(); update_appkeypad(); screen->gsets[0] = 'B'; --- 3063,3069 ---- term->flags &= ~ORIGIN; if(full) { TabReset (term->tabs); ! term->keyboard.flags = 0; update_appcursor(); update_appkeypad(); screen->gsets[0] = 'B'; *** /tmp/cxterm/cxterm/HZinMthd.c Wed Oct 2 15:43:34 1991 --- cxterm/HZinMthd.c Tue Jun 23 10:56:27 1992 *************** *** 1,5 **** /* ! * $Id: HZinMthd.c,v 1.3 1991/10/02 20:42:13 ygz Exp $ */ /*********************************************************** --- 1,5 ---- /* ! * $Id: HZinMthd.c,v 1.4 1992/01/01 06:24:08 ygz Exp ygz $ */ /*********************************************************** *************** *** 28,34 **** #include "ptyx.h" /* X headers included here. */ #include #include - #include #include #include #include --- 28,33 ---- *************** *** 71,80 **** HZinputTable *cHZtbl; /* current HZ input table */ int (*HZfilterInput)(); /* current filter function */ ! int hzTableFilter(); ! int hzASCIIfilter(); ! int hzICfilter(); ! int hzQWfilter(); struct pdHZinput { char *name; /* name of input method */ --- 70,90 ---- HZinputTable *cHZtbl; /* current HZ input table */ int (*HZfilterInput)(); /* current filter function */ ! /* local static function declarations here */ ! static int HZLoadInputTable(); ! static int hzTableFilter(); ! static int hzASCIIfilter(); ! static int hzICfilter(); ! static int hzQWfilter(); ! static void initBufAndChoice(); ! static void makeChoice(); ! static void moveChoiceR(); ! static void moveChoiceL(); ! static void fillDpyChoices(); ! static void saveInputHistory(); ! static void restoreInputHistory(); ! static void clearInputHistory(); ! static void setMaxChoices(); struct pdHZinput { char *name; /* name of input method */ *************** *** 177,182 **** --- 187,193 ---- Char dpyChoices[MAX_DPYCHOICE]; /* input choices to be displayed */ int dpyChoicesLen; /* length of dpyChoices[] */ + /******************************************************************/ /* ARGSUSED */ void HandleSwitchHZMode(w, event, params, nparams) *************** *** 319,353 **** /* * HZLoadInputTable -- load the HZ input table */ ! static HZLoadInputTable(screen, name, hztbl) TScreen *screen; char *name; HZinputTable *hztbl; { char filename[MAXPATHLEN]; - char *dir, *pcolon; char tmpstr[80], magic[2]; Boolean found = FALSE; FILE *file; /* search name in different dirs */ ! dir = screen->hzIwin.it_dirs; ! if (dir) { ! do { ! pcolon = index(dir, ':'); ! if (pcolon) ! *pcolon++ = '\0'; ! strcpy (filename, dir); strcat (filename, "/"); strcat (filename, name); strcat (filename, CIT_SUFFIX); if (access (filename, R_OK) == 0) found = TRUE; ! dir = pcolon; ! } while (pcolon && ! found); ! } else { ! /* try . */ strcpy (filename, name); strcat (filename, CIT_SUFFIX); if (access (filename, R_OK) == 0) --- 330,378 ---- /* * HZLoadInputTable -- load the HZ input table */ ! static int HZLoadInputTable(screen, name, hztbl) TScreen *screen; char *name; HZinputTable *hztbl; { char filename[MAXPATHLEN]; char tmpstr[80], magic[2]; Boolean found = FALSE; FILE *file; + if (name[0] == '/') { + /* try root directory first */ + strcpy (filename, name); + strcat (filename, CIT_SUFFIX); + if (access (filename, R_OK) == 0) + found = TRUE; + } + /* search name in different dirs */ + if ((! found) && screen->hzIwin.it_dirs) { + register char *dir = screen->hzIwin.it_dirs; + register char *pfilename; ! while (*dir && (! found)) { ! /* copy from (dir) to (filename), till ':' or end of string */ ! pfilename = filename; ! while ((*dir != '\0') && (*dir != ':')) ! *pfilename++ = *dir++ ; ! *pfilename = '\0'; ! strcat (filename, "/"); strcat (filename, name); strcat (filename, CIT_SUFFIX); if (access (filename, R_OK) == 0) found = TRUE; ! ! if (*dir == ':') ! dir++ ; /* skip this ':', ready for next component dir */ ! } ! } ! ! if ((! found) && (name[0] != '/')) { ! /* try current directory */ strcpy (filename, name); strcat (filename, CIT_SUFFIX); if (access (filename, R_OK) == 0) *************** *** 460,465 **** --- 485,492 ---- strbuf[0] = hztbl->hzList[tnptr->tn_hzidx].byte1; strbuf[1] = hztbl->hzList[tnptr->tn_hzidx].byte2; + saveInputHistory (); /* save this HZ input */ + initBufAndChoice (hztbl); /* must reset before Clear */ HZi_ClearHzInput (screen); return (2); /* 2 bytes converted in strbuf[] */ *************** *** 677,683 **** } ! static initBufAndChoice (hztbl) HZinputTable *hztbl; { hzinbufCount = 0; --- 704,710 ---- } ! static void initBufAndChoice (hztbl) HZinputTable *hztbl; { hzinbufCount = 0; *************** *** 714,720 **** } } ! static makeChoice (hztbl, max_rc) HZinputTable *hztbl; int max_rc; /* maximun choices on screen */ { --- 741,747 ---- } } ! static void makeChoice (hztbl, max_rc) HZinputTable *hztbl; int max_rc; /* maximun choices on screen */ { *************** *** 730,736 **** fillDpyChoices (hztbl); } ! static moveChoiceR (hztbl, max_rc) HZinputTable *hztbl; int max_rc; /* maximun choices on screen */ { --- 757,763 ---- fillDpyChoices (hztbl); } ! static void moveChoiceR (hztbl, max_rc) HZinputTable *hztbl; int max_rc; /* maximun choices on screen */ { *************** *** 746,752 **** fillDpyChoices (hztbl); } ! static moveChoiceL (hztbl, max_rc) HZinputTable *hztbl; int max_rc; /* maximun choices on screen */ { --- 773,779 ---- fillDpyChoices (hztbl); } ! static void moveChoiceL (hztbl, max_rc) HZinputTable *hztbl; int max_rc; /* maximun choices on screen */ { *************** *** 762,768 **** fillDpyChoices (hztbl); } ! static fillDpyChoices (hztbl) HZinputTable *hztbl; { register int i; --- 789,795 ---- fillDpyChoices (hztbl); } ! static void fillDpyChoices (hztbl) HZinputTable *hztbl; { register int i; *************** *** 814,824 **** return (pct->codeint); } ! static int saveInputHistory() { /* make minimum effords in save */ save_hzinbufCount = hzinbufCount; ! strncpy (save_hzinbuf, hzinbuf, hzinbufCount); save_hzChoicePtr = hzChoicePtr; save_numChoice = numChoice; save_numChoiceR = numChoiceR; --- 841,851 ---- return (pct->codeint); } ! static void saveInputHistory() { /* make minimum effords in save */ save_hzinbufCount = hzinbufCount; ! strncpy ((char *)save_hzinbuf, (char *)hzinbuf, hzinbufCount); save_hzChoicePtr = hzChoicePtr; save_numChoice = numChoice; save_numChoiceR = numChoiceR; *************** *** 826,838 **** inputSaved = 1; } ! static int restoreInputHistory(hztbl) HZinputTable *hztbl; { register int i; hzinbufCount = save_hzinbufCount; ! strncpy (hzinbuf, save_hzinbuf, hzinbufCount); hzChoicePtr = save_hzChoicePtr; numChoice = save_numChoice; numChoiceR = save_numChoiceR; --- 853,865 ---- inputSaved = 1; } ! static void restoreInputHistory(hztbl) HZinputTable *hztbl; { register int i; hzinbufCount = save_hzinbufCount; ! strncpy ((char *)hzinbuf, (char *)save_hzinbuf, hzinbufCount); hzChoicePtr = save_hzChoicePtr; numChoice = save_numChoice; numChoiceR = save_numChoiceR; *************** *** 859,870 **** fillDpyChoices (hztbl); } ! static int clearInputHistory() { inputSaved = 0; } ! static int setMaxChoices (screen, maxchoice) TScreen *screen; int maxchoice; { --- 886,897 ---- fillDpyChoices (hztbl); } ! static void clearInputHistory() { inputSaved = 0; } ! static void setMaxChoices (screen, maxchoice) TScreen *screen; int maxchoice; { *** /tmp/cxterm/cxterm/cxterm.man Wed Oct 2 16:00:07 1991 --- cxterm/cxterm.man Sat Mar 21 16:34:49 1992 *************** *** 1,4 **** ! .\" $Id: cxterm.man,v 1.3 1991/10/02 20:59:31 ygz Exp $ .TH CXTERM 1 "Release 5" "X Version 11" .SH NAME cxterm \- Chinese terminal emulator for X --- 1,4 ---- ! .\" $Id: cxterm.man,v 1.4 1992/03/21 21:34:42 ygz Exp $ .TH CXTERM 1 "Release 5" "X Version 11" .SH NAME cxterm \- Chinese terminal emulator for X *************** *** 269,274 **** --- 269,275 ---- .SH "SEE ALSO" .BI X (1), .BI xterm (1), + .BI resize (1), .BI hzimpath (1), .BI tit2cit (1) .SH COPYRIGHT *************** *** 277,283 **** Please also see \fIX(1)\fP for a full statement of rights and permissions for X11R5. .SH AUTHORS ! \fIXterm\fP is part of the X window system Version 11 Release 4 developed in MIT. .PP This version of \fIcxterm\fP is rewritten by Yongguang Zhang (now with Purdue University, e-mail: ygz@cs.purdue.edu) --- 278,285 ---- Please also see \fIX(1)\fP for a full statement of rights and permissions for X11R5. .SH AUTHORS ! \fIXterm\fP is part of the X window system Version 11 Release 5 ! developed in MIT. .PP This version of \fIcxterm\fP is rewritten by Yongguang Zhang (now with Purdue University, e-mail: ygz@cs.purdue.edu) *** /tmp/cxterm/dict/tit2cit/tit2cit.c Mon Oct 21 00:19:21 1991 --- dict/tit2cit/tit2cit.c Mon Jul 13 00:39:34 1992 *************** *** 1,5 **** /* ! * $Id: tit2cit.c,v 1.5 1991/10/21 05:19:03 ygz Exp $ */ /*********************************************************************** --- 1,5 ---- /* ! * $Id: tit2cit.c,v 1.6 1992/07/13 05:39:14 ygz Exp $ */ /*********************************************************************** *************** *** 254,260 **** Error (errstr); } hzInputTable.keyprompt[ch].ptlen = strlen (strbuf); ! strncpy (hzInputTable.keyprompt[ch].prompt, strbuf, hzInputTable.keyprompt[ch].ptlen); } else if (strcmp (key, "PROMPT:") == 0) { --- 254,260 ---- Error (errstr); } hzInputTable.keyprompt[ch].ptlen = strlen (strbuf); ! strncpy ((char *)hzInputTable.keyprompt[ch].prompt, strbuf, hzInputTable.keyprompt[ch].ptlen); } else if (strcmp (key, "PROMPT:") == 0) {