home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume11 / tcsh.4.3 / part02 / DIFFS.2
Encoding:
Text File  |  1987-09-27  |  59.9 KB  |  2,911 lines

  1. *** sh.glob.c    Tue May 13 01:27:18 1986
  2. --- /usr/src/local/tcsh/sh.glob.c    Mon Aug 17 21:32:21 1987
  3. ***************
  4. *** 9,15
  5.   #endif
  6.   
  7.   #include "sh.h"
  8. ! #include <sys/dir.h>
  9.   
  10.   /*
  11.    * C Shell
  12.  
  13. --- 9,15 -----
  14.   #endif
  15.   
  16.   #include "sh.h"
  17. ! /* #include <sys/dir.h> */
  18.   
  19.   /*
  20.    * C Shell
  21. ***************
  22. *** 118,123
  23.   sortscmp(a1, a2)
  24.       char **a1, **a2;
  25.   {
  26.   
  27.        return (strcmp(*a1, *a2));
  28.   }
  29.  
  30. --- 118,132 -----
  31.   sortscmp(a1, a2)
  32.       char **a1, **a2;
  33.   {
  34. +     if (!a1)            /* check for NULL */
  35. +         return (a2?1:0);
  36. +     if (!a2)
  37. +         return (-1);
  38. +     
  39. +     if (!*a1)            /* check for NULL */
  40. +         return (*a2?1:0);
  41. +     if (!*a2)
  42. +         return (-1);
  43.   
  44.        return (strcmp(*a1, *a2));
  45.   }
  46. ***************
  47. *** 131,136
  48.   
  49.       sgpathp = gpathp;
  50.       cs = as;
  51.       if (*cs == '~' && gpathp == gpath) {
  52.           addpath('~');
  53.           for (cs++; letter(*cs) || digit(*cs) || *cs == '-';)
  54.  
  55. --- 140,164 -----
  56.   
  57.       sgpathp = gpathp;
  58.       cs = as;
  59. +     /*
  60. +      * kfk - 17 Jan 1984 - stack hack
  61. +      * allows user to get at arbitrary dir names in stack.
  62. +      */
  63. +     if (*cs == '=' && gpathp == gpath) {
  64. +         addpath ('=');
  65. +         if (digit (*++cs) || *cs == '-') {
  66. +             int dig;
  67. +             dig = (*cs == '-') ? -1 : *cs - '0';
  68. +             cs++;
  69. +             if (*cs && *cs != '/')
  70. +                 error ("Stack hack: =<dig>{/path...}");
  71. +             getstakd (gpath, dig, 1);
  72. +                 /* last "1" = call error if needed */
  73. +             gpathp = strend (gpath);
  74. +         }
  75. +     }
  76. +     /* kfk - end stack hack change */
  77.       if (*cs == '~' && gpathp == gpath) {
  78.           addpath('~');
  79.           for (cs++; letter(*cs) || digit(*cs) || *cs == '-';)
  80. ***************
  81. *** 295,301
  82.       register char *sentp;
  83.       char sglobbed = globbed;
  84.   
  85. !     if (*s == '.' && *p != '.')
  86.           return (0);
  87.       sentp = entp;
  88.       entp = s;
  89.  
  90. --- 323,329 -----
  91.       register char *sentp;
  92.       char sglobbed = globbed;
  93.   
  94. !     if (*s == '.' && *p != '.') /* PWP: this makes [.]login != .login */
  95.           return (0);
  96.       sentp = entp;
  97.       entp = s;
  98. ***************
  99. *** 309,315
  100.       register char *s, *p;
  101.   {
  102.       register int scc;
  103. !     int ok, lc;
  104.       char *sgpathp;
  105.       struct stat stb;
  106.       int c, cc;
  107.  
  108. --- 337,343 -----
  109.       register char *s, *p;
  110.   {
  111.       register int scc;
  112. !     int ok, lc, notin;
  113.       char *sgpathp;
  114.       struct stat stb;
  115.       int c, cc;
  116. ***************
  117. *** 322,328
  118.           case '{':
  119.               return (execbrc(p - 1, s - 1));
  120.   
  121. !         case '[':
  122.               ok = 0;
  123.               lc = 077777;
  124.               while (cc = *p++) {
  125.  
  126. --- 350,357 -----
  127.           case '{':
  128.               return (execbrc(p - 1, s - 1));
  129.   
  130. !         case '[':    /* PWP -- BRACKET IS HERE!! */
  131. !             if (!scc) return 0; /* if at end if string */
  132.               ok = 0;
  133.               lc = 077777;
  134.               if (*p == '^') {
  135. ***************
  136. *** 325,330
  137.           case '[':
  138.               ok = 0;
  139.               lc = 077777;
  140.               while (cc = *p++) {
  141.                   if (cc == ']') {
  142.                       if (ok)
  143.  
  144. --- 354,364 -----
  145.               if (!scc) return 0; /* if at end if string */
  146.               ok = 0;
  147.               lc = 077777;
  148. +             if (*p == '^') {
  149. +                 notin = 1;
  150. +                 p++;
  151. +             } else
  152. +                 notin = 0;
  153.               while (cc = *p++) {
  154.                   if (cc == ']') {
  155.                       if (notin) { /* PWP for not in list */
  156. ***************
  157. *** 327,335
  158.               lc = 077777;
  159.               while (cc = *p++) {
  160.                   if (cc == ']') {
  161. !                     if (ok)
  162. !                         break;
  163. !                     return (0);
  164.                   }
  165.                   if (cc == '-') {
  166.                       if (lc <= scc && scc <= *p++)
  167.  
  168. --- 361,377 -----
  169.                   notin = 0;
  170.               while (cc = *p++) {
  171.                   if (cc == ']') {
  172. !                     if (notin) { /* PWP for not in list */
  173. !                         if (!ok)
  174. !                             break;
  175. !                         else
  176. !                             return (0);
  177. !                     } else {
  178. !                         if (ok)
  179. !                             break;
  180. !                         else
  181. !                             return (0);
  182. !                     }
  183.                   }
  184.                   if (cc == '-') {
  185.                       if (lc <= scc && scc <= *p++)
  186. ***************
  187. *** 335,341
  188.                       if (lc <= scc && scc <= *p++)
  189.                           ok++;
  190.                   } else
  191. !                     if (scc == (lc = cc))
  192.                           ok++;
  193.               }
  194.               if (cc == 0)
  195.  
  196. --- 377,383 -----
  197.                       if (lc <= scc && scc <= *p++)
  198.                           ok++;
  199.                   } else
  200. !                     if (scc && (scc == (lc = cc)))
  201.                           ok++;
  202.               }
  203.               if (cc == 0)
  204. ***************
  205. *** 393,399
  206.       register char *s, *p;
  207.   {
  208.       register int scc;
  209. !     int ok, lc;
  210.       int c, cc;
  211.   
  212.       for (;;) {
  213.  
  214. --- 435,441 -----
  215.       register char *s, *p;
  216.   {
  217.       register int scc;
  218. !     int ok, lc, notin;
  219.       int c, cc;
  220.   
  221.       for (;;) {
  222. ***************
  223. *** 400,406
  224.           scc = *s++ & TRIM;
  225.           switch (c = *p++) {
  226.   
  227. !         case '[':
  228.               ok = 0;
  229.               lc = 077777;
  230.               while (cc = *p++) {
  231.  
  232. --- 442,449 -----
  233.           scc = *s++ & TRIM;
  234.           switch (c = *p++) {
  235.   
  236. !         case '[':    /* PWP -- HERE TOO!! */
  237. !             if (!scc) return 0; /* if at end if string */
  238.               ok = 0;
  239.               lc = 077777;
  240.               if (*p == '^') {
  241. ***************
  242. *** 403,408
  243.           case '[':
  244.               ok = 0;
  245.               lc = 077777;
  246.               while (cc = *p++) {
  247.                   if (cc == ']') {
  248.                       if (ok)
  249.  
  250. --- 446,456 -----
  251.               if (!scc) return 0; /* if at end if string */
  252.               ok = 0;
  253.               lc = 077777;
  254. +             if (*p == '^') {
  255. +                 notin = 1;
  256. +                 p++;
  257. +             } else
  258. +                 notin = 0;
  259.               while (cc = *p++) {
  260.                   if (cc == ']') {
  261.                       if (notin) { /* PWP for not in list */
  262. ***************
  263. *** 405,410
  264.               lc = 077777;
  265.               while (cc = *p++) {
  266.                   if (cc == ']') {
  267.                       if (ok)
  268.                           break;
  269.                       return (0);
  270.  
  271. --- 453,464 -----
  272.                   notin = 0;
  273.               while (cc = *p++) {
  274.                   if (cc == ']') {
  275. +                     if (notin) { /* PWP for not in list */
  276. +                         if (!ok)
  277. +                         break;
  278. +                         else
  279. +                         return (0);
  280. +                     } else {
  281.                       if (ok)
  282.                           break;
  283.                           else
  284. ***************
  285. *** 407,412
  286.                   if (cc == ']') {
  287.                       if (ok)
  288.                           break;
  289.                       return (0);
  290.                   }
  291.                   if (cc == '-') {
  292.  
  293. --- 461,467 -----
  294.                       } else {
  295.                       if (ok)
  296.                           break;
  297. +                         else
  298.                       return (0);
  299.                   }
  300.                   }
  301. ***************
  302. *** 409,414
  303.                           break;
  304.                       return (0);
  305.                   }
  306.                   if (cc == '-') {
  307.                       if (lc <= scc && scc <= *p++)
  308.                           ok++;
  309.  
  310. --- 464,470 -----
  311.                           else
  312.                       return (0);
  313.                   }
  314. +                 }
  315.                   if (cc == '-') {
  316.                       if (lc <= scc && scc <= *p++)
  317.                           ok++;
  318. ***************
  319. *** 413,419
  320.                       if (lc <= scc && scc <= *p++)
  321.                           ok++;
  322.                   } else
  323. !                     if (scc == (lc = cc))
  324.                           ok++;
  325.               }
  326.               if (cc == 0)
  327.  
  328. --- 469,475 -----
  329.                       if (lc <= scc && scc <= *p++)
  330.                           ok++;
  331.                   } else
  332. !                     if (scc && (scc == (lc = cc)))
  333.                           ok++;
  334.               }
  335.               if (cc == 0)
  336. ***************
  337. *** 503,509
  338.       register char *p, c;
  339.   
  340.       while (p = *t++) {
  341. !         if (*p == '~')
  342.               gflag |= 2;
  343.           else if (*p == '{' && (p[1] == '\0' || p[1] == '}' && p[2] == '\0'))
  344.               continue;
  345.  
  346. --- 559,566 -----
  347.       register char *p, c;
  348.   
  349.       while (p = *t++) {
  350. !             /* added additional '=' test for stack hack */
  351. !         if ((*p == '~') || (*p == '='))
  352.               gflag |= 2;
  353.           else if (*p == '{' && (p[1] == '\0' || p[1] == '}' && p[2] == '\0'))
  354.               continue;
  355. *** sh.h    Sat Mar 29 07:37:09 1986
  356. --- /usr/src/local/tcsh/sh.h    Mon Aug 17 22:48:18 1987
  357. ***************
  358. *** 8,13
  359.   
  360.   #include <sys/time.h>
  361.   #include <sys/resource.h>
  362.   #include <sys/param.h>
  363.   #include <sys/stat.h>
  364.   #include <sys/signal.h>
  365.  
  366. --- 8,16 -----
  367.   
  368.   #include <sys/time.h>
  369.   #include <sys/resource.h>
  370. + #ifdef    SVID
  371. + #include <sys/types.h>
  372. + #endif
  373.   #include <sys/param.h>
  374.   #include <sys/stat.h>
  375.   #include <sys/signal.h>
  376. ***************
  377. *** 28,33
  378.   
  379.   #define    isdir(d)    ((d.st_mode & S_IFMT) == S_IFDIR)
  380.   
  381.   typedef    char    bool;
  382.   
  383.   #define    eq(a, b)    (strcmp(a, b) == 0)
  384.  
  385. --- 31,78 -----
  386.   
  387.   #define    isdir(d)    ((d.st_mode & S_IFMT) == S_IFDIR)
  388.   
  389. + #include <sys/ioctl.h>
  390. + #ifndef SVID
  391. + #include <sgtty.h>
  392. + #include <sys/dir.h>
  393. + #else SVID
  394. + # ifdef OREO
  395. + #include <sgtty.h>
  396. + #include <sys/dir.h>
  397. + # else OREO
  398. + #include "dir.h"
  399. + # endif OREO
  400. + #endif SVID
  401. + /* #include <ctype.h> */
  402. + #include <pwd.h>
  403. + #ifdef SVID
  404. + # ifndef pyr
  405. + #include <time.h>
  406. + # endif pyr
  407. + #include <termio.h>
  408. + #endif
  409. +     
  410. + /*
  411. +  * kfk 26 Jan 1984 - for login watch functions.
  412. +  */
  413. + #include <utmp.h>
  414. + struct who {
  415. +     struct who *w_next;
  416. +     struct who *w_prev;
  417. +     char w_name[10];
  418. +     char w_new[10];
  419. +     char w_tty[10];
  420. +     int w_status;
  421. + };
  422. + #define ONLINE        01
  423. + #define OFFLINE        02
  424. + #define CHANGED        04
  425. + #define ANNOUNCE    010
  426. + /* kfk - end change */
  427.   typedef    char    bool;
  428.   
  429.   /* kfk - additions to support scheduled commands */
  430. ***************
  431. *** 30,35
  432.   
  433.   typedef    char    bool;
  434.   
  435.   #define    eq(a, b)    (strcmp(a, b) == 0)
  436.   
  437.   /*
  438.  
  439. --- 75,89 -----
  440.   /* kfk - end change */
  441.   typedef    char    bool;
  442.   
  443. + /* kfk - additions to support scheduled commands */
  444. + struct sched_event {
  445. +     struct    sched_event    *t_next;
  446. +     long            t_when;
  447. +     char            **t_lex;
  448. + };
  449. + extern    long    time();
  450. + /* kfk - end change */
  451.   #define    eq(a, b)    (strcmp(a, b) == 0)
  452.   
  453.   /*
  454. ***************
  455. *** 51,59
  456.   bool    setintr;        /* Set interrupts on/off -> Wait intr... */
  457.   bool    timflg;            /* Time the next waited for command */
  458.   bool    havhash;        /* path hashing is available */
  459. - #ifdef FILEC
  460. - bool    filec;            /* doing filename expansion */
  461. - #endif
  462.   
  463.   /*
  464.    * Global i/o info
  465.  
  466. --- 105,110 -----
  467.   bool    setintr;        /* Set interrupts on/off -> Wait intr... */
  468.   bool    timflg;            /* Time the next waited for command */
  469.   bool    havhash;        /* path hashing is available */
  470.   
  471.   /*
  472.    * Global i/o info
  473. ***************
  474. *** 66,71
  475.   int    errno;            /* Error from C library routines */
  476.   char    *shtemp;        /* Temp name for << shell files in /tmp */
  477.   struct    timeval time0;        /* Time at which the shell started */
  478.   struct    rusage ru0;
  479.   
  480.   /*
  481.  
  482. --- 117,123 -----
  483.   int    errno;            /* Error from C library routines */
  484.   char    *shtemp;        /* Temp name for << shell files in /tmp */
  485.   struct    timeval time0;        /* Time at which the shell started */
  486. + #ifndef OREO
  487.   struct    rusage ru0;
  488.   #endif OREO
  489.   
  490. ***************
  491. *** 67,72
  492.   char    *shtemp;        /* Temp name for << shell files in /tmp */
  493.   struct    timeval time0;        /* Time at which the shell started */
  494.   struct    rusage ru0;
  495.   
  496.   /*
  497.    * Miscellany
  498.  
  499. --- 119,125 -----
  500.   struct    timeval time0;        /* Time at which the shell started */
  501.   #ifndef OREO
  502.   struct    rusage ru0;
  503. + #endif OREO
  504.   
  505.   /*
  506.    * Miscellany
  507. ***************
  508. *** 79,84
  509.   /* If tpgrp is -1, leave tty alone! */
  510.   int    opgrp;            /* Initial pgrp and tty pgrp */
  511.   int    oldisc;            /* Initial line discipline or -1 */
  512.   
  513.   /*
  514.    * These are declared here because they want to be
  515.  
  516. --- 132,140 -----
  517.   /* If tpgrp is -1, leave tty alone! */
  518.   int    opgrp;            /* Initial pgrp and tty pgrp */
  519.   int    oldisc;            /* Initial line discipline or -1 */
  520. + char PromptBuf[256];        /* buffer for the actual printed prompt.
  521. +                    this is used in tenex.c and sh.c for
  522. +                    pegets.c */
  523.   
  524.   /*
  525.    * These are declared here because they want to be
  526. ***************
  527. *** 369,374
  528.       struct    wordent Hlex;
  529.       int    Hnum;
  530.       int    Href;
  531.       struct    Hist *Hnext;
  532.   } Histlist;
  533.   
  534.  
  535. --- 425,431 -----
  536.       struct    wordent Hlex;
  537.       int    Hnum;
  538.       int    Href;
  539. +     long    Htime;
  540.       struct    Hist *Hnext;
  541.   } Histlist;
  542.   
  543. ***************
  544. *** 423,428
  545.   char    *index();
  546.   struct    biltins *isbfunc();
  547.   off_t    lseek();
  548.   char    *operate();
  549.   int    phup();
  550.   int    pintr();
  551.  
  552. --- 480,486 -----
  553.   char    *index();
  554.   struct    biltins *isbfunc();
  555.   off_t    lseek();
  556. + struct    tm *localtime();
  557.   char    *operate();
  558.   int    phup();
  559.   int    pintr();
  560. ***************
  561. *** 471,473
  562.       char    *iname;        /* name from /usr/include */
  563.       char    *pname;        /* print name */
  564.   } mesg[];
  565.  
  566. --- 529,534 -----
  567.       char    *iname;        /* name from /usr/include */
  568.       char    *pname;        /* print name */
  569.   } mesg[];
  570. + #define    sighold(sig)    sigblock(sigmask(sig))
  571. +     
  572. *** sh.hist.c    Thu Jun  6 13:15:33 1985
  573. --- /usr/src/local/tcsh/sh.hist.c    Mon Aug 17 21:32:24 1987
  574. ***************
  575. *** 53,58
  576.       register struct Hist *np;
  577.   
  578.       np = (struct Hist *) xalloc(sizeof *np);
  579.       np->Hnum = np->Href = event;
  580.       if (docopy)
  581.           copylex(&np->Hlex, lp);
  582.  
  583. --- 53,59 -----
  584.       register struct Hist *np;
  585.   
  586.       np = (struct Hist *) xalloc(sizeof *np);
  587. +     time(&(np->Htime));
  588.       np->Hnum = np->Href = event;
  589.       if (docopy)
  590.           copylex(&np->Hlex, lp);
  591. ***************
  592. *** 135,140
  593.       register struct Hist *hp;
  594.       int hflg;
  595.   {
  596.   
  597.       if (hflg == 0)
  598.           printf("%6d\t", hp->Hnum);
  599.  
  600. --- 136,143 -----
  601.       register struct Hist *hp;
  602.       int hflg;
  603.   {
  604. +     struct tm *t;
  605. +     char ampm = 'a';
  606.   
  607.       if (hflg == 0)
  608.       {
  609. ***************
  610. *** 137,142
  611.   {
  612.   
  613.       if (hflg == 0)
  614.           printf("%6d\t", hp->Hnum);
  615.       prlex(&hp->Hlex);
  616.   }
  617.  
  618. --- 140,146 -----
  619.       char ampm = 'a';
  620.   
  621.       if (hflg == 0)
  622. +     {
  623.           printf("%6d\t", hp->Hnum);
  624.           t = localtime(&hp->Htime);
  625.           if (t->tm_hour >= 12)
  626. ***************
  627. *** 138,142
  628.   
  629.       if (hflg == 0)
  630.           printf("%6d\t", hp->Hnum);
  631.       prlex(&hp->Hlex);
  632.   }
  633.  
  634. --- 142,157 -----
  635.       if (hflg == 0)
  636.       {
  637.           printf("%6d\t", hp->Hnum);
  638. +         t = localtime(&hp->Htime);
  639. +         if (t->tm_hour >= 12)
  640. +         {
  641. +             if (t->tm_hour > 12)
  642. +                 t->tm_hour -= 12;
  643. +             ampm = 'p';
  644. +         }
  645. +         else if (t->tm_hour == 0)
  646. +             t->tm_hour = 12;
  647. +         printf ("%2d:%02d%cm\t", t->tm_hour, t->tm_min, ampm);
  648. +     }
  649.       prlex(&hp->Hlex);
  650.   }
  651. *** sh.init.c    Thu Jun  6 13:15:48 1985
  652. --- /usr/src/local/tcsh/sh.init.c    Tue Aug 18 21:57:22 1987
  653. ***************
  654. *** 16,21
  655.   
  656.   extern    int doalias();
  657.   extern    int dobg();
  658.   extern    int dobreak();
  659.   extern    int dochngd();
  660.   extern    int docontin();
  661.  
  662. --- 16,22 -----
  663.   
  664.   extern    int doalias();
  665.   extern    int dobg();
  666. + extern    int dobind();
  667.   extern    int dobreak();
  668.   extern    int dochngd();
  669.   extern    int docontin();
  670. ***************
  671. *** 37,42
  672.   extern    int dojobs();
  673.   extern    int dokill();
  674.   extern    int dolet();
  675.   extern    int dolimit();
  676.   extern    int dologin();
  677.   extern    int dologout();
  678.  
  679. --- 38,44 -----
  680.   extern    int dojobs();
  681.   extern    int dokill();
  682.   extern    int dolet();
  683. + #ifndef OREO
  684.   extern    int dolimit();
  685.   #endif
  686.   extern    int dolog();
  687. ***************
  688. *** 38,43
  689.   extern    int dokill();
  690.   extern    int dolet();
  691.   extern    int dolimit();
  692.   extern    int dologin();
  693.   extern    int dologout();
  694.   #ifdef NEWGRP
  695.  
  696. --- 40,47 -----
  697.   extern    int dolet();
  698.   #ifndef OREO
  699.   extern    int dolimit();
  700. + #endif
  701. + extern    int dolog();
  702.   extern    int dologin();
  703.   extern    int dologout();
  704.   #ifdef NEWGRP
  705. ***************
  706. *** 50,55
  707.   extern    int dopopd();
  708.   extern    int dopushd();
  709.   extern    int dorepeat();
  710.   extern    int doset();
  711.   extern    int dosetenv();
  712.   extern    int dosource();
  713.  
  714. --- 54,60 -----
  715.   extern    int dopopd();
  716.   extern    int dopushd();
  717.   extern    int dorepeat();
  718. + extern    int dosched();
  719.   extern    int doset();
  720.   extern    int dosetenv();
  721.   extern    int dosource();
  722. ***************
  723. *** 58,63
  724.   extern    int doswbrk();
  725.   extern    int doswitch();
  726.   extern    int dotime();
  727.   extern    int dounlimit();
  728.   extern    int doumask();
  729.   extern    int dowait();
  730.  
  731. --- 63,69 -----
  732.   extern    int doswbrk();
  733.   extern    int doswitch();
  734.   extern    int dotime();
  735. + #ifndef OREO
  736.   extern    int dounlimit();
  737.   #endif
  738.   extern    int doumask();
  739. ***************
  740. *** 59,64
  741.   extern    int doswitch();
  742.   extern    int dotime();
  743.   extern    int dounlimit();
  744.   extern    int doumask();
  745.   extern    int dowait();
  746.   extern    int dowhile();
  747.  
  748. --- 65,71 -----
  749.   extern    int dotime();
  750.   #ifndef OREO
  751.   extern    int dounlimit();
  752. + #endif
  753.   extern    int doumask();
  754.   extern    int dowait();
  755.   extern    int dowhile();
  756. ***************
  757. *** 74,79
  758.   extern    int dounhash();
  759.   extern    int unset();
  760.   extern    int dounsetenv();
  761.   
  762.   #define    INF    1000
  763.   
  764.  
  765. --- 81,87 -----
  766.   extern    int dounhash();
  767.   extern    int unset();
  768.   extern    int dounsetenv();
  769. + extern    int dolist();        /* for ls-F */
  770.   
  771.   #define    INF    1000
  772.   
  773. ***************
  774. *** 86,91
  775.       "alias",    doalias,    0,    INF,
  776.       "alloc",    showall,    0,    1,
  777.       "bg",        dobg,        0,    INF,
  778.       "break",    dobreak,    0,    0,
  779.       "breaksw",    doswbrk,    0,    0,
  780.   #ifdef IIASA
  781.  
  782. --- 94,100 -----
  783.       "alias",    doalias,    0,    INF,
  784.       "alloc",    showall,    0,    1,
  785.       "bg",        dobg,        0,    INF,
  786. +     "bind",        dobind,        0,    2,
  787.       "break",    dobreak,    0,    0,
  788.       "breaksw",    doswbrk,    0,    0,
  789.   #ifdef IIASA
  790. ***************
  791. *** 119,124
  792.       "if",        doif,        1,    INF,
  793.       "jobs",        dojobs,        0,    1,
  794.       "kill",        dokill,        1,    INF,
  795.       "limit",    dolimit,    0,    3,
  796.       "login",    dologin,    0,    1,
  797.       "logout",    dologout,    0,    0,
  798.  
  799. --- 128,134 -----
  800.       "if",        doif,        1,    INF,
  801.       "jobs",        dojobs,        0,    1,
  802.       "kill",        dokill,        1,    INF,
  803. + #ifndef OREO
  804.       "limit",    dolimit,    0,    3,
  805.   #endif OREO
  806.       "linedit",    doecho,        0,    INF,
  807. ***************
  808. *** 120,125
  809.       "jobs",        dojobs,        0,    1,
  810.       "kill",        dokill,        1,    INF,
  811.       "limit",    dolimit,    0,    3,
  812.       "login",    dologin,    0,    1,
  813.       "logout",    dologout,    0,    0,
  814.   #ifdef NEWGRP
  815.  
  816. --- 130,138 -----
  817.       "kill",        dokill,        1,    INF,
  818.   #ifndef OREO
  819.       "limit",    dolimit,    0,    3,
  820. + #endif OREO
  821. +     "linedit",    doecho,        0,    INF,
  822. +     "log",        dolog,        0,    0,
  823.       "login",    dologin,    0,    1,
  824.       "logout",    dologout,    0,    0,
  825.       "ls-F",        dolist,        0,    INF,
  826. ***************
  827. *** 122,127
  828.       "limit",    dolimit,    0,    3,
  829.       "login",    dologin,    0,    1,
  830.       "logout",    dologout,    0,    0,
  831.   #ifdef NEWGRP
  832.       "newgrp",    donewgrp,    1,    1,
  833.   #endif
  834.  
  835. --- 135,141 -----
  836.       "log",        dolog,        0,    0,
  837.       "login",    dologin,    0,    1,
  838.       "logout",    dologout,    0,    0,
  839. +     "ls-F",        dolist,        0,    INF,
  840.   #ifdef NEWGRP
  841.       "newgrp",    donewgrp,    1,    1,
  842.   #endif
  843. ***************
  844. *** 136,141
  845.   #endif
  846.       "rehash",    dohash,        0,    0,
  847.       "repeat",    dorepeat,    2,    INF,
  848.       "set",        doset,        0,    INF,
  849.       "setenv",    dosetenv,    0,    2,
  850.       "shift",    shift,        0,    1,
  851.  
  852. --- 150,156 -----
  853.   #endif
  854.       "rehash",    dohash,        0,    0,
  855.       "repeat",    dorepeat,    2,    INF,
  856. +     "sched",    dosched,    0,    INF,
  857.       "set",        doset,        0,    INF,
  858.       "setenv",    dosetenv,    0,    2,
  859.       "shift",    shift,        0,    1,
  860. ***************
  861. *** 147,152
  862.       "umask",    doumask,    0,    1,
  863.       "unalias",    unalias,    1,    INF,
  864.       "unhash",    dounhash,    0,    0,
  865.       "unlimit",    dounlimit,    0,    INF,
  866.       "unset",    unset,        1,    INF,
  867.       "unsetenv",    dounsetenv,    1,    INF,
  868.  
  869. --- 162,168 -----
  870.       "umask",    doumask,    0,    1,
  871.       "unalias",    unalias,    1,    INF,
  872.       "unhash",    dounhash,    0,    0,
  873. + #ifndef OREO
  874.       "unlimit",    dounlimit,    0,    INF,
  875.   #endif
  876.       "unset",    unset,        1,    INF,
  877. ***************
  878. *** 148,153
  879.       "unalias",    unalias,    1,    INF,
  880.       "unhash",    dounhash,    0,    0,
  881.       "unlimit",    dounlimit,    0,    INF,
  882.       "unset",    unset,        1,    INF,
  883.       "unsetenv",    dounsetenv,    1,    INF,
  884.       "wait",        dowait,        0,    0,
  885.  
  886. --- 164,170 -----
  887.       "unhash",    dounhash,    0,    0,
  888.   #ifndef OREO
  889.       "unlimit",    dounlimit,    0,    INF,
  890. + #endif
  891.       "unset",    unset,        1,    INF,
  892.       "unsetenv",    dounsetenv,    1,    INF,
  893.       "wait",        dowait,        0,    0,
  894. ***************
  895. *** 219,224
  896.       "PIPE",    "Broken pipe",
  897.       "ALRM",    "Alarm clock",
  898.       "TERM",    "Terminated",
  899.       "URG",    "Urgent I/O condition",
  900.       "STOP",    "Stopped (signal)",
  901.       "TSTP",    "Stopped",
  902.  
  903. --- 236,243 -----
  904.       "PIPE",    "Broken pipe",
  905.       "ALRM",    "Alarm clock",
  906.       "TERM",    "Terminated",
  907. + #ifdef SVID
  908. + # ifdef pyr            /* these are really the BSD sigs, plus a few */
  909.       "URG",    "Urgent I/O condition",
  910.       "STOP",    "Stopped (signal)",
  911.       "TSTP",    "Stopped",
  912. ***************
  913. *** 226,232
  914.       "CHLD",    "Child exited",
  915.       "TTIN", "Stopped (tty input)",
  916.       "TTOU", "Stopped (tty output)",
  917. !     "IO",    "I/O possible",
  918.       "XCPU",    "Cputime limit exceeded",
  919.       "XFSZ", "Filesize limit exceeded",
  920.       "VTALRM","Virtual timer expired",
  921.  
  922. --- 245,251 -----
  923.       "CHLD",    "Child exited",
  924.       "TTIN", "Stopped (tty input)",
  925.       "TTOU", "Stopped (tty output)",
  926. !     "IO",   "I/O possible",
  927.       "XCPU",    "Cputime limit exceeded",
  928.       "XFSZ", "Filesize limit exceeded",
  929.       "VTALRM", "Virtual time alarm",
  930. ***************
  931. *** 229,237
  932.       "IO",    "I/O possible",
  933.       "XCPU",    "Cputime limit exceeded",
  934.       "XFSZ", "Filesize limit exceeded",
  935. !     "VTALRM","Virtual timer expired",
  936. !     "PROF",    "Profiling timer expired",
  937. !     "WINCH","Window size changed",
  938.       0,    "Signal 29",
  939.       "USR1",    "User defined signal 1",
  940.       "USR2",    "User defined signal 2",
  941.  
  942. --- 248,286 -----
  943.       "IO",   "I/O possible",
  944.       "XCPU",    "Cputime limit exceeded",
  945.       "XFSZ", "Filesize limit exceeded",
  946. !     "VTALRM", "Virtual time alarm",
  947. !     "PROF",    "Profiling time alarm",
  948. !     "USR1",    "User signal 1",
  949. !     "USR2",    "User signal 2",
  950. !     "PWR",    "Power failure",
  951. !     0,    "Signal 31",
  952. !     0,    "Signal 32"
  953. ! # else pyr            /* the first four real SVID sigs. */
  954. !     "USR1",    "User signal 1",
  955. !     "USR2", "User signal 2",
  956. !     "CHLD",    "Child exited",
  957. !     "PWR",  "Power failure",
  958. ! #  ifdef OREO
  959. !     "TSTP",    "Stopped",
  960. !     "TTIN", "Stopped (tty input)",
  961. !     "TTOU", "Stopped (tty output)",
  962. !     "STOP",    "Stopped (signal)",
  963. !     "XCPU",    "Cputime limit exceeded",
  964. !     "XFSZ", "Filesize limit exceeded",
  965. !     "VTALRM", "Virtual time alarm",
  966. !     "PROF", "Profiling time alarm",
  967. !     "WINCH", "Window size changed",
  968. !     "CONT",    "Continued",
  969. ! #  else OREO
  970. !     0,    "Signal 20",
  971. !     0,    "Signal 21",
  972. !     0,    "Signal 22",
  973. !     0,    "Signal 23",
  974. !     0,    "Signal 24",
  975. !     0,    "Signal 25",
  976. !     0,    "Signal 26",
  977. !     0,    "Signal 27",
  978. !     0,    "Signal 28",
  979.       0,    "Signal 29",
  980.   #  endif OREO
  981.       0,    "Signal 30",
  982. ***************
  983. *** 233,238
  984.       "PROF",    "Profiling timer expired",
  985.       "WINCH","Window size changed",
  986.       0,    "Signal 29",
  987.       "USR1",    "User defined signal 1",
  988.       "USR2",    "User defined signal 2",
  989.       0,    "Signal 32"
  990.  
  991. --- 282,321 -----
  992.       0,    "Signal 27",
  993.       0,    "Signal 28",
  994.       0,    "Signal 29",
  995. + #  endif OREO
  996. +     0,    "Signal 30",
  997. +     0,    "Signal 31",
  998. +     0,    "Signal 32"
  999. + # endif pyr
  1000. + #else SVID
  1001. +     "URG",    "Urgent I/O condition",
  1002. +     "STOP",    "Stopped (signal)",
  1003. +     "TSTP",    "Stopped",
  1004. +     "CONT",    "Continued",
  1005. +     "CHLD",    "Child exited",
  1006. +     "TTIN", "Stopped (tty input)",
  1007. +     "TTOU", "Stopped (tty output)",
  1008. +     "IO",   "I/O possible",
  1009. +     "XCPU",    "Cputime limit exceeded",
  1010. +     "XFSZ", "Filesize limit exceeded",
  1011. +     "VTALRM", "Virtual time alarm",
  1012. +     "PROF",    "Profiling time alarm",
  1013. + # ifdef sun
  1014. +     "WINCH", "Window size changed",
  1015. +     "LOST",    "Resource lost",
  1016. +     "USR1",    "User signal 1",
  1017. +     "USR2",    "User signal 2",
  1018. +     0,    "Signal 32"
  1019. + # else sun
  1020. + #  ifdef pyr
  1021. +     "USR1",    "User signal 1",
  1022. +     "USR2",    "User signal 2",
  1023. +     "PWR",    "Power failure",
  1024. +     0,    "Signal 31",
  1025. +     0,    "Signal 32"
  1026. + #  else pyr
  1027. +     "WINCH", "Window size changed",
  1028. +     0,    "Signal 29",
  1029.       "USR1",    "User defined signal 1",
  1030.       "USR2",    "User defined signal 2",
  1031.       0,    "Signal 32"
  1032. ***************
  1033. *** 236,239
  1034.       "USR1",    "User defined signal 1",
  1035.       "USR2",    "User defined signal 2",
  1036.       0,    "Signal 32"
  1037.   };
  1038.  
  1039. --- 319,325 -----
  1040.       "USR1",    "User defined signal 1",
  1041.       "USR2",    "User defined signal 2",
  1042.       0,    "Signal 32"
  1043. + #  endif pyr
  1044. + # endif sun
  1045. + #endif SVID
  1046.   };
  1047. *** sh.lex.c    Sat Mar 29 07:38:02 1986
  1048. --- /usr/src/local/tcsh/sh.lex.c    Thu Sep 17 23:23:42 1987
  1049. ***************
  1050. *** 9,15
  1051.   #endif
  1052.   
  1053.   #include "sh.h"
  1054. - #include <sgtty.h>
  1055.   
  1056.   /*
  1057.    * C shell
  1058.  
  1059. --- 9,14 -----
  1060.   #endif
  1061.   
  1062.   #include "sh.h"
  1063.   
  1064.   /*
  1065.    * C shell
  1066. ***************
  1067. *** 221,234
  1068.                       c |= QUOTE;
  1069.                   else {
  1070.                       if (c == '\n')
  1071. !                         /*
  1072. !                         if (c1 == '`')
  1073. !                             c = ' ';
  1074. !                         else
  1075. !                         */
  1076. !                             c |= QUOTE;
  1077. !                     ungetC(c);
  1078. !                     c = '\\';
  1079.                   }
  1080.               } else if (c == '\n') {
  1081.                   seterrc("Unmatched ", c1);
  1082.  
  1083. --- 220,234 -----
  1084.                       c |= QUOTE;
  1085.                   else {
  1086.                       if (c == '\n')
  1087. !                         c |= QUOTE;
  1088. !                     else if (c == '"')
  1089. !                         c |= QUOTE;
  1090. !                     else if (c == '\'')
  1091. !                         c |= QUOTE;
  1092. !                     else {
  1093. !                         ungetC(c);
  1094. !                         c = '\\';
  1095. !                     }
  1096.                   }
  1097.               } else if (c == '\n') {
  1098.                   seterrc("Unmatched ", c1);
  1099. ***************
  1100. *** 1126,1131
  1101.   reread:
  1102.           c = bgetc();
  1103.           if (c < 0) {
  1104.               struct sgttyb tty;
  1105.   
  1106.               if (wanteof)
  1107.  
  1108. --- 1126,1135 -----
  1109.   reread:
  1110.           c = bgetc();
  1111.           if (c < 0) {
  1112. + #ifdef    SVID
  1113. + #include <termio.h>
  1114. +             struct termio tty;
  1115. + #else
  1116.               struct sgttyb tty;
  1117.   #endif SVID
  1118.   
  1119. ***************
  1120. *** 1127,1132
  1121.           c = bgetc();
  1122.           if (c < 0) {
  1123.               struct sgttyb tty;
  1124.   
  1125.               if (wanteof)
  1126.                   return (-1);
  1127.  
  1128. --- 1131,1137 -----
  1129.               struct termio tty;
  1130.   #else
  1131.               struct sgttyb tty;
  1132. + #endif SVID
  1133.   
  1134.               if (wanteof)
  1135.                   return (-1);
  1136. ***************
  1137. *** 1131,1136
  1138.               if (wanteof)
  1139.                   return (-1);
  1140.               /* was isatty but raw with ignoreeof yields problems */
  1141.               if (ioctl(SHIN, TIOCGETP, (char *)&tty) == 0 &&
  1142.                   (tty.sg_flags & RAW) == 0) {
  1143.                   /* was 'short' for FILEC */
  1144.  
  1145. --- 1136,1145 -----
  1146.               if (wanteof)
  1147.                   return (-1);
  1148.               /* was isatty but raw with ignoreeof yields problems */
  1149. + #ifdef SVID
  1150. +             if (ioctl(SHIN, TCGETA, &tty)==0 &&
  1151. +                 (tty.c_cc[VEOF] != CEOF)) {
  1152. + #else SVID
  1153.               if (ioctl(SHIN, TIOCGETP, (char *)&tty) == 0 &&
  1154.                   (tty.sg_flags & RAW) == 0) {
  1155.   #endif
  1156. ***************
  1157. *** 1133,1139
  1158.               /* was isatty but raw with ignoreeof yields problems */
  1159.               if (ioctl(SHIN, TIOCGETP, (char *)&tty) == 0 &&
  1160.                   (tty.sg_flags & RAW) == 0) {
  1161. !                 /* was 'short' for FILEC */
  1162.                   int ctpgrp;
  1163.   
  1164.                   if (++sincereal > 25)
  1165.  
  1166. --- 1142,1148 -----
  1167.   #else SVID
  1168.               if (ioctl(SHIN, TIOCGETP, (char *)&tty) == 0 &&
  1169.                   (tty.sg_flags & RAW) == 0) {
  1170. ! #endif
  1171.                   int ctpgrp;
  1172.   
  1173.                   if (++sincereal > 25)
  1174. ***************
  1175. *** 1138,1143
  1176.   
  1177.                   if (++sincereal > 25)
  1178.                       goto oops;
  1179.                   if (tpgrp != -1 &&
  1180.                       ioctl(FSHTTY, TIOCGPGRP, (char *)&ctpgrp) == 0 &&
  1181.                       tpgrp != ctpgrp) {
  1182.  
  1183. --- 1147,1153 -----
  1184.   
  1185.                   if (++sincereal > 25)
  1186.                       goto oops;
  1187. + #ifdef BSDJOBS
  1188.                   if (tpgrp != -1 &&
  1189.                       ioctl(FSHTTY, TIOCGPGRP, (char *)&ctpgrp) == 0 &&
  1190.                       tpgrp != ctpgrp) {
  1191. ***************
  1192. *** 1147,1152
  1193.   printf("Reset tty pgrp from %d to %d\n", ctpgrp, tpgrp);
  1194.                       goto reread;
  1195.                   }
  1196.                   if (adrof("ignoreeof")) {
  1197.                       if (loginsh)
  1198.                           printf("\nUse \"logout\" to logout.\n");
  1199.  
  1200. --- 1157,1163 -----
  1201.   printf("Reset tty pgrp from %d to %d\n", ctpgrp, tpgrp);
  1202.                       goto reread;
  1203.                   }
  1204. + #endif BSDJOBS
  1205.                   if (adrof("ignoreeof")) {
  1206.                       if (loginsh)
  1207.                           printf("\nUse \"logout\" to logout.\n");
  1208. ***************
  1209. *** 1151,1157
  1210.                       if (loginsh)
  1211.                           printf("\nUse \"logout\" to logout.\n");
  1212.                       else
  1213. !                         printf("\nUse \"exit\" to leave csh.\n");
  1214.                       reset();
  1215.                   }
  1216.                   if (chkstop == 0)
  1217.  
  1218. --- 1162,1168 -----
  1219.                       if (loginsh)
  1220.                           printf("\nUse \"logout\" to logout.\n");
  1221.                       else
  1222. !                         printf("\nUse \"exit\" to leave tcsh.\n");
  1223.                       reset();
  1224.                   }
  1225.                   if (chkstop == 0)
  1226. ***************
  1227. *** 1171,1178
  1228.   bgetc()
  1229.   {
  1230.       register int buf, off, c;
  1231. ! #ifdef FILEC
  1232. !     char ttyline[BUFSIZ];
  1233.       register int numleft = 0, roomleft;
  1234.   #endif
  1235.   
  1236.  
  1237. --- 1182,1188 -----
  1238.   bgetc()
  1239.   {
  1240.       register int buf, off, c;
  1241. !     extern char InputBuf[];
  1242.       register int numleft = 0, roomleft;
  1243.   
  1244.   #ifdef TELL
  1245. ***************
  1246. *** 1174,1180
  1247.   #ifdef FILEC
  1248.       char ttyline[BUFSIZ];
  1249.       register int numleft = 0, roomleft;
  1250. - #endif
  1251.   
  1252.   #ifdef TELL
  1253.       if (cantell) {
  1254.  
  1255. --- 1184,1189 -----
  1256.       register int buf, off, c;
  1257.       extern char InputBuf[];
  1258.       register int numleft = 0, roomleft;
  1259.   
  1260.   #ifdef TELL
  1261.       if (cantell) {
  1262. ***************
  1263. *** 1187,1193
  1264.               do
  1265.                   c = read(SHIN, fbuf[0], BUFSIZ);
  1266.               while (c < 0 && errno == EINTR);
  1267. !             if (c <= 0)
  1268.                   return (-1);
  1269.               feobp += c;
  1270.           }
  1271.  
  1272. --- 1196,1202 -----
  1273.               do
  1274.                   c = read(SHIN, fbuf[0], BUFSIZ);
  1275.               while (c < 0 && errno == EINTR);
  1276. !             if (c <= 0) {
  1277.                   return (-1);
  1278.               }
  1279.               feobp += c;
  1280. ***************
  1281. *** 1189,1194
  1282.               while (c < 0 && errno == EINTR);
  1283.               if (c <= 0)
  1284.                   return (-1);
  1285.               feobp += c;
  1286.           }
  1287.           c = fbuf[0][fseekp - fbobp];
  1288.  
  1289. --- 1198,1204 -----
  1290.               while (c < 0 && errno == EINTR);
  1291.               if (c <= 0) {
  1292.                   return (-1);
  1293. +             }
  1294.               feobp += c;
  1295.           }
  1296.           c = fbuf[0][fseekp - fbobp];
  1297. ***************
  1298. *** 1210,1216
  1299.           fbuf = nfbuf;
  1300.           fbuf[fblocks] = calloc(BUFSIZ, sizeof (char));
  1301.           fblocks++;
  1302. !         goto again;
  1303.       }
  1304.       if (fseekp >= feobp) {
  1305.           buf = (int) feobp / BUFSIZ;
  1306.  
  1307. --- 1220,1227 -----
  1308.           fbuf = nfbuf;
  1309.           fbuf[fblocks] = calloc(BUFSIZ, sizeof (char));
  1310.           fblocks++;
  1311. !         if (!intty)
  1312. !             goto again;
  1313.       }
  1314.       if (fseekp >= feobp) {
  1315.           buf = (int) feobp / BUFSIZ;
  1316. ***************
  1317. *** 1215,1221
  1318.       if (fseekp >= feobp) {
  1319.           buf = (int) feobp / BUFSIZ;
  1320.           off = (int) feobp % BUFSIZ;
  1321. ! #ifndef FILEC
  1322.           for (;;) {
  1323.               c = read(SHIN, fbuf[buf] + off, BUFSIZ - off);
  1324.   #else
  1325.  
  1326. --- 1226,1232 -----
  1327.       if (fseekp >= feobp) {
  1328.           buf = (int) feobp / BUFSIZ;
  1329.           off = (int) feobp % BUFSIZ;
  1330. !          roomleft = BUFSIZ - off;
  1331.           for (;;) {
  1332.               if (intty) {     /* then use twenex routine */
  1333.                   /* PWP: get a line */
  1334. ***************
  1335. *** 1217,1234
  1336.           off = (int) feobp % BUFSIZ;
  1337.   #ifndef FILEC
  1338.           for (;;) {
  1339. !             c = read(SHIN, fbuf[buf] + off, BUFSIZ - off);
  1340. ! #else
  1341. !         roomleft = BUFSIZ - off;
  1342. !         for (;;) {
  1343. !             if (filec && intty) {
  1344. !                 c = numleft ? numleft : tenex(ttyline, BUFSIZ);
  1345. !                 if (c > roomleft) {
  1346. !                     /* start with fresh buffer */
  1347. !                     feobp = fseekp = fblocks * BUFSIZ;
  1348. !                     numleft = c;
  1349. !                     goto again;
  1350. !                 }
  1351.                   if (c > 0)
  1352.                       copy(fbuf[buf] + off, ttyline, c);
  1353.                   numleft = 0;
  1354.  
  1355. --- 1228,1244 -----
  1356.           off = (int) feobp % BUFSIZ;
  1357.            roomleft = BUFSIZ - off;
  1358.           for (;;) {
  1359. !             if (intty) {     /* then use twenex routine */
  1360. !                 /* PWP: get a line */
  1361. !                 c = numleft ? numleft : Inputl();
  1362. !                 if (c > roomleft) /* No room in this buffer? */
  1363. !                     {
  1364. !                         /* start with fresh buffer */
  1365. !                         feobp = fseekp =
  1366. !                             fblocks * BUFSIZ;
  1367. !                         numleft = c;
  1368. !                         goto again;
  1369. !                     }
  1370.                   if (c > 0)
  1371.                       copy (fbuf[buf] + off, InputBuf, c);
  1372.                   /* copy (fbuf[buf] + off, ttyline, c); */
  1373. ***************
  1374. *** 1230,1236
  1375.                       goto again;
  1376.                   }
  1377.                   if (c > 0)
  1378. !                     copy(fbuf[buf] + off, ttyline, c);
  1379.                   numleft = 0;
  1380.               } else
  1381.                   c = read(SHIN, fbuf[buf] + off, roomleft);
  1382.  
  1383. --- 1240,1247 -----
  1384.                           goto again;
  1385.                       }
  1386.                   if (c > 0)
  1387. !                     copy (fbuf[buf] + off, InputBuf, c);
  1388. !                 /* copy (fbuf[buf] + off, ttyline, c); */
  1389.                   numleft = 0;
  1390.               }
  1391.               else {
  1392. ***************
  1393. *** 1232,1238
  1394.                   if (c > 0)
  1395.                       copy(fbuf[buf] + off, ttyline, c);
  1396.                   numleft = 0;
  1397. !             } else
  1398.                   c = read(SHIN, fbuf[buf] + off, roomleft);
  1399.   #endif
  1400.               if (c >= 0)
  1401.  
  1402. --- 1243,1250 -----
  1403.                       copy (fbuf[buf] + off, InputBuf, c);
  1404.                   /* copy (fbuf[buf] + off, ttyline, c); */
  1405.                   numleft = 0;
  1406. !             }
  1407. !             else {
  1408.                   c = read(SHIN, fbuf[buf] + off, roomleft);
  1409.               }
  1410.               if (c >= 0)
  1411. ***************
  1412. *** 1234,1240
  1413.                   numleft = 0;
  1414.               } else
  1415.                   c = read(SHIN, fbuf[buf] + off, roomleft);
  1416. ! #endif
  1417.               if (c >= 0)
  1418.                   break;
  1419.               if (errno == EWOULDBLOCK) {
  1420.  
  1421. --- 1246,1252 -----
  1422.               }
  1423.               else {
  1424.                   c = read(SHIN, fbuf[buf] + off, roomleft);
  1425. !             }
  1426.               if (c >= 0)
  1427.                   break;
  1428.               if (errno == EWOULDBLOCK) {
  1429. ***************
  1430. *** 1239,1245
  1431.                   break;
  1432.               if (errno == EWOULDBLOCK) {
  1433.                   int off = 0;
  1434.                   (void) ioctl(SHIN, FIONBIO, (char *)&off);
  1435.               } else if (errno != EINTR)
  1436.                   break;
  1437.  
  1438. --- 1251,1257 -----
  1439.                   break;
  1440.               if (errno == EWOULDBLOCK) {
  1441.                   int off = 0;
  1442. !                 
  1443.                   (void) ioctl(SHIN, FIONBIO, (char *)&off);
  1444.               } else if (errno != EINTR)
  1445.                   break;
  1446. ***************
  1447. *** 1244,1250
  1448.               } else if (errno != EINTR)
  1449.                   break;
  1450.           }
  1451. !         if (c <= 0)
  1452.               return (-1);
  1453.           feobp += c;
  1454.   #ifndef FILEC
  1455.  
  1456. --- 1256,1262 -----
  1457.               } else if (errno != EINTR)
  1458.                   break;
  1459.           }
  1460. !         if (c <= 0) {
  1461.               return (-1);
  1462.           }
  1463.           feobp += c;
  1464. ***************
  1465. *** 1246,1251
  1466.           }
  1467.           if (c <= 0)
  1468.               return (-1);
  1469.           feobp += c;
  1470.   #ifndef FILEC
  1471.           goto again;
  1472.  
  1473. --- 1258,1264 -----
  1474.           }
  1475.           if (c <= 0) {
  1476.               return (-1);
  1477. +         }
  1478.           feobp += c;
  1479.           if (!intty)
  1480.               goto again;
  1481. ***************
  1482. *** 1247,1256
  1483.           if (c <= 0)
  1484.               return (-1);
  1485.           feobp += c;
  1486. ! #ifndef FILEC
  1487. !         goto again;
  1488. ! #else
  1489. !         if (filec && !intty)
  1490.               goto again;
  1491.   #endif
  1492.       }
  1493.  
  1494. --- 1260,1266 -----
  1495.               return (-1);
  1496.           }
  1497.           feobp += c;
  1498. !         if (!intty)
  1499.               goto again;
  1500.       }
  1501.       c = fbuf[buf][(int) fseekp % BUFSIZ];
  1502. ***************
  1503. *** 1252,1258
  1504.   #else
  1505.           if (filec && !intty)
  1506.               goto again;
  1507. - #endif
  1508.       }
  1509.       c = fbuf[buf][(int) fseekp % BUFSIZ];
  1510.       fseekp++;
  1511.  
  1512. --- 1262,1267 -----
  1513.           feobp += c;
  1514.           if (!intty)
  1515.               goto again;
  1516.       }
  1517.       c = fbuf[buf][(int) fseekp % BUFSIZ];
  1518.       fseekp++;
  1519. *** sh.local.h    Thu Jun  6 13:15:34 1985
  1520. --- /usr/src/local/tcsh/sh.local.h    Mon Aug 17 21:32:31 1987
  1521. ***************
  1522. *** 22,28
  1523.    */
  1524.   
  1525.   #define    BUFSIZ    1024        /* default buffer size */
  1526. ! #define    SHELLPATH    "/bin/csh"
  1527.   #define    OTHERSH        "/bin/sh"
  1528.   #define FORKSLEEP    10    /* delay loop on non-interactive fork failure */
  1529.   #define    MAILINTVL    600    /* 10 minutes */
  1530.  
  1531. --- 22,30 -----
  1532.    */
  1533.   
  1534.   #define    BUFSIZ    1024        /* default buffer size */
  1535. ! #ifndef SHELLPATH
  1536. ! #define    SHELLPATH    "/bin/tcsh"
  1537. ! #endif
  1538.   #define    OTHERSH        "/bin/sh"
  1539.   #define FORKSLEEP    10    /* delay loop on non-interactive fork failure */
  1540.   #define    MAILINTVL    600    /* 10 minutes */
  1541. *** sh.misc.c    Sat Mar 29 07:37:28 1986
  1542. --- /usr/src/local/tcsh/sh.misc.c    Mon Aug 17 21:32:32 1987
  1543. ***************
  1544. *** 88,94
  1545.   #else
  1546.       showall(av);
  1547.       printf("i=%d: Out of memory\n", i);
  1548. !     chdir("/usr/bill/cshcore");
  1549.       abort();
  1550.   #endif
  1551.       return 0;        /* fool lint */
  1552.  
  1553. --- 88,94 -----
  1554.   #else
  1555.       showall(av);
  1556.       printf("i=%d: Out of memory\n", i);
  1557. !     /* chdir("/usr/bill/cshcore"); */
  1558.       abort();
  1559.   #endif
  1560.       return 0;        /* fool lint */
  1561. *** sh.print.c    Thu Jun  6 13:15:28 1985
  1562. --- /usr/src/local/tcsh/sh.print.c    Mon Aug 17 21:44:36 1987
  1563. ***************
  1564. *** 42,48
  1565.       printf("%d%d", i / 10, i % 10);
  1566.   }
  1567.   
  1568. ! char    linbuf[128];
  1569.   char    *linp = linbuf;
  1570.   
  1571.   putchar(c)
  1572.  
  1573. --- 42,48 -----
  1574.       printf("%d%d", i / 10, i % 10);
  1575.   }
  1576.   
  1577. ! char    linbuf[2048];        /* was 128 */
  1578.   char    *linp = linbuf;
  1579.   int lbuffed = 1;        /* true if line buffered */
  1580.   
  1581. ***************
  1582. *** 44,49
  1583.   
  1584.   char    linbuf[128];
  1585.   char    *linp = linbuf;
  1586.   
  1587.   putchar(c)
  1588.       register int c;
  1589.  
  1590. --- 44,50 -----
  1591.   
  1592.   char    linbuf[2048];        /* was 128 */
  1593.   char    *linp = linbuf;
  1594. + int lbuffed = 1;        /* true if line buffered */
  1595.   
  1596.   putchar(c)
  1597.       register int c;
  1598. ***************
  1599. *** 49,55
  1600.       register int c;
  1601.   {
  1602.   
  1603. !     if ((c & QUOTE) == 0 && (c == 0177 || c < ' ' && c != '\t' && c != '\n')) {
  1604.           putchar('^');
  1605.           if (c == 0177)
  1606.               c = '?';
  1607.  
  1608. --- 50,56 -----
  1609.       register int c;
  1610.   {
  1611.   
  1612. !     if ((c & QUOTE) == 0 && (c == 0177 || c < ' ' && c != '\t' && c != '\n' && c != '\r')) {
  1613.           putchar('^');
  1614.           if (c == 0177)
  1615.               c = '?';
  1616. ***************
  1617. *** 58,64
  1618.       }
  1619.       c &= TRIM;
  1620.       *linp++ = c;
  1621. !     if (c == '\n' || linp >= &linbuf[sizeof linbuf - 2])
  1622.           flush();
  1623.   }
  1624.   
  1625.  
  1626. --- 59,65 -----
  1627.       }
  1628.       c &= TRIM;
  1629.       *linp++ = c;
  1630. !     if ((lbuffed && c == '\n') || linp >= &linbuf[sizeof linbuf - 2])
  1631.           flush();
  1632.   }
  1633.   
  1634. ***************
  1635. *** 62,67
  1636.           flush();
  1637.   }
  1638.   
  1639.   draino()
  1640.   {
  1641.   
  1642.  
  1643. --- 63,77 -----
  1644.           flush();
  1645.   }
  1646.   
  1647. + putraw(c)
  1648. +     register int c;
  1649. + {
  1650. +     c &= TRIM;
  1651. +     *linp++ = c;
  1652. +     if (linp >= &linbuf[sizeof linbuf - 2])
  1653. +         flush();
  1654. + }
  1655.   draino()
  1656.   {
  1657.   
  1658. ***************
  1659. *** 87,92
  1660.           (void) write(unit, "\n", 1);
  1661.       }
  1662.   #endif
  1663. !     (void) write(unit, linbuf, linp - linbuf);
  1664.       linp = linbuf;
  1665.   }
  1666.  
  1667. --- 97,102 -----
  1668.           (void) write(unit, "\n", 1);
  1669.       }
  1670.   #endif
  1671. !     (void) write(unit, linbuf, (int) (linp - linbuf));
  1672.       linp = linbuf;
  1673.   }
  1674. *** sh.proc.c    Tue May 13 01:12:46 1986
  1675. --- /usr/src/local/tcsh/sh.proc.c    Mon Aug 17 21:32:39 1987
  1676. ***************
  1677. *** 34,39
  1678.       register int pid;
  1679.       union wait w;
  1680.       int jobflags;
  1681.       struct rusage ru;
  1682.   
  1683.   loop:
  1684.  
  1685. --- 34,40 -----
  1686.       register int pid;
  1687.       union wait w;
  1688.       int jobflags;
  1689. + #ifndef OREO
  1690.       struct rusage ru;
  1691.   #endif
  1692.   
  1693. ***************
  1694. *** 35,40
  1695.       union wait w;
  1696.       int jobflags;
  1697.       struct rusage ru;
  1698.   
  1699.   loop:
  1700.       pid = wait3(&w, (setintr ? WNOHANG|WUNTRACED:WNOHANG), &ru);
  1701.  
  1702. --- 36,42 -----
  1703.       int jobflags;
  1704.   #ifndef OREO
  1705.       struct rusage ru;
  1706. + #endif
  1707.   
  1708.   loop:
  1709.       pid = wait3(&w, (setintr ? WNOHANG|WUNTRACED:WNOHANG),
  1710. ***************
  1711. *** 37,43
  1712.       struct rusage ru;
  1713.   
  1714.   loop:
  1715. !     pid = wait3(&w, (setintr ? WNOHANG|WUNTRACED:WNOHANG), &ru);
  1716.       if (pid <= 0) {
  1717.           if (errno == EINTR) {
  1718.               errno = 0;
  1719.  
  1720. --- 39,50 -----
  1721.   #endif
  1722.   
  1723.   loop:
  1724. !     pid = wait3(&w, (setintr ? WNOHANG|WUNTRACED:WNOHANG),
  1725. ! #ifdef    OREO
  1726. !             0);
  1727. ! #else    OREO
  1728. !             &ru);
  1729. ! #endif    OREO
  1730.       if (pid <= 0) {
  1731.           if (errno == EINTR) {
  1732.               errno = 0;
  1733. ***************
  1734. *** 60,65
  1735.       } else {
  1736.           if (pp->p_flags & (PTIME|PPTIME) || adrof("time"))
  1737.               (void) gettimeofday(&pp->p_etime, (struct timezone *)0);
  1738.           pp->p_rusage = ru;
  1739.           if (WIFSIGNALED(w)) {
  1740.               if (w.w_termsig == SIGINT)
  1741.  
  1742. --- 67,73 -----
  1743.       } else {
  1744.           if (pp->p_flags & (PTIME|PPTIME) || adrof("time"))
  1745.               (void) gettimeofday(&pp->p_etime, (struct timezone *)0);
  1746. + #ifndef    OREO
  1747.           pp->p_rusage = ru;
  1748.   #endif OREO
  1749.           if (WIFSIGNALED(w)) {
  1750. ***************
  1751. *** 61,66
  1752.           if (pp->p_flags & (PTIME|PPTIME) || adrof("time"))
  1753.               (void) gettimeofday(&pp->p_etime, (struct timezone *)0);
  1754.           pp->p_rusage = ru;
  1755.           if (WIFSIGNALED(w)) {
  1756.               if (w.w_termsig == SIGINT)
  1757.                   pp->p_flags |= PINTERRUPTED;
  1758.  
  1759. --- 69,75 -----
  1760.               (void) gettimeofday(&pp->p_etime, (struct timezone *)0);
  1761.   #ifndef    OREO
  1762.           pp->p_rusage = ru;
  1763. + #endif OREO
  1764.           if (WIFSIGNALED(w)) {
  1765.               if (w.w_termsig == SIGINT)
  1766.                   pp->p_flags |= PINTERRUPTED;
  1767. ***************
  1768. *** 211,216
  1769.           sigpause(sigblock(0) &~ sigmask(SIGCHLD));
  1770.       }
  1771.       (void) sigsetmask(omask);
  1772.       if (tpgrp > 0)            /* get tty back */
  1773.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&tpgrp);
  1774.       if ((jobflags&(PSIGNALED|PSTOPPED|PTIME)) ||
  1775.  
  1776. --- 220,226 -----
  1777.           sigpause(sigblock(0) &~ sigmask(SIGCHLD));
  1778.       }
  1779.       (void) sigsetmask(omask);
  1780. + #ifdef    BSDJOBS
  1781.       if (tpgrp > 0)            /* get tty back */
  1782.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&tpgrp);
  1783.   #endif    BSDJOBS
  1784. ***************
  1785. *** 213,218
  1786.       (void) sigsetmask(omask);
  1787.       if (tpgrp > 0)            /* get tty back */
  1788.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&tpgrp);
  1789.       if ((jobflags&(PSIGNALED|PSTOPPED|PTIME)) ||
  1790.            !eq(dcwd->di_name, fp->p_cwd->di_name)) {
  1791.           if (jobflags&PSTOPPED)
  1792.  
  1793. --- 223,229 -----
  1794.   #ifdef    BSDJOBS
  1795.       if (tpgrp > 0)            /* get tty back */
  1796.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&tpgrp);
  1797. + #endif    BSDJOBS
  1798.       if ((jobflags&(PSIGNALED|PSTOPPED|PTIME)) ||
  1799.            !eq(dcwd->di_name, fp->p_cwd->di_name)) {
  1800.           if (jobflags&PSTOPPED)
  1801. ***************
  1802. *** 628,633
  1803.           if (pp->p_flags&PPTIME && !(status&(PSTOPPED|PRUNNING))) {
  1804.               if (linp != linbuf)
  1805.                   printf("\n\t");
  1806.               { static struct rusage zru;
  1807.                 prusage(&zru, &pp->p_rusage, &pp->p_etime,
  1808.                   &pp->p_btime);
  1809.  
  1810. --- 639,645 -----
  1811.           if (pp->p_flags&PPTIME && !(status&(PSTOPPED|PRUNNING))) {
  1812.               if (linp != linbuf)
  1813.                   printf("\n\t");
  1814. + #ifndef OREO
  1815.               { static struct rusage zru;
  1816.                 prusage(&zru, &pp->p_rusage, &pp->p_etime,
  1817.                   &pp->p_btime);
  1818. ***************
  1819. *** 632,637
  1820.                 prusage(&zru, &pp->p_rusage, &pp->p_etime,
  1821.                   &pp->p_btime);
  1822.               }
  1823.           }
  1824.           if (tp == pp->p_friends) {
  1825.               if (linp != linbuf)
  1826.  
  1827. --- 644,650 -----
  1828.                 prusage(&zru, &pp->p_rusage, &pp->p_etime,
  1829.                   &pp->p_btime);
  1830.               }
  1831. + #endif OREO
  1832.           }
  1833.           if (tp == pp->p_friends) {
  1834.               if (linp != linbuf)
  1835. ***************
  1836. *** 654,659
  1837.   ptprint(tp)
  1838.       register struct process *tp;
  1839.   {
  1840.       struct timeval tetime, diff;
  1841.       static struct timeval ztime;
  1842.       struct rusage ru;
  1843.  
  1844. --- 667,675 -----
  1845.   ptprint(tp)
  1846.       register struct process *tp;
  1847.   {
  1848. + #ifdef OREO
  1849. +     printf ("There is no time stuff for OREO yet (sorry).\n");
  1850. + #else OREO
  1851.       struct timeval tetime, diff;
  1852.       static struct timeval ztime;
  1853.       struct rusage ru;
  1854. ***************
  1855. *** 669,674
  1856.               tetime = diff;
  1857.       } while ((pp = pp->p_friends) != tp);
  1858.       prusage(&zru, &ru, &tetime, &ztime);
  1859.   }
  1860.   
  1861.   /*
  1862.  
  1863. --- 685,691 -----
  1864.               tetime = diff;
  1865.       } while ((pp = pp->p_friends) != tp);
  1866.       prusage(&zru, &ru, &tetime, &ztime);
  1867. + #endif OREO
  1868.   }
  1869.   
  1870.   /*
  1871. ***************
  1872. *** 896,901
  1873.       if (!foregnd)
  1874.           pclrcurr(pp);
  1875.       (void) pprint(pp, foregnd ? NAME|JOBDIR : NUMBER|NAME|AMPERSAND);
  1876.       if (foregnd)
  1877.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pp->p_jobid);
  1878.       if (jobflags&PSTOPPED)
  1879.  
  1880. --- 913,919 -----
  1881.       if (!foregnd)
  1882.           pclrcurr(pp);
  1883.       (void) pprint(pp, foregnd ? NAME|JOBDIR : NUMBER|NAME|AMPERSAND);
  1884. + #ifdef    BSDJOBS
  1885.       if (foregnd)
  1886.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pp->p_jobid);
  1887.       if (jobflags&PSTOPPED)
  1888. ***************
  1889. *** 900,905
  1890.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pp->p_jobid);
  1891.       if (jobflags&PSTOPPED)
  1892.           (void) killpg(pp->p_jobid, SIGCONT);
  1893.       (void) sigsetmask(omask);
  1894.   }
  1895.   
  1896.  
  1897. --- 918,924 -----
  1898.           (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pp->p_jobid);
  1899.       if (jobflags&PSTOPPED)
  1900.           (void) killpg(pp->p_jobid, SIGCONT);
  1901. + #endif    BSDJOBS
  1902.       (void) sigsetmask(omask);
  1903.   }
  1904.   
  1905. ***************
  1906. *** 1063,1068
  1907.               (void) signal(SIGINT, SIG_IGN);
  1908.               (void) signal(SIGQUIT, SIG_IGN);
  1909.           }
  1910.           if (wanttty > 0)
  1911.               (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pgrp);
  1912.           if (wanttty >= 0 && tpgrp >= 0)
  1913.  
  1914. --- 1082,1088 -----
  1915.               (void) signal(SIGINT, SIG_IGN);
  1916.               (void) signal(SIGQUIT, SIG_IGN);
  1917.           }
  1918. + #ifdef BSDJOBS
  1919.           if (wanttty > 0)
  1920.               (void) ioctl(FSHTTY, TIOCSPGRP, (char *)&pgrp);
  1921.           if (wanttty >= 0 && tpgrp >= 0)
  1922. ***************
  1923. *** 1069,1074
  1924.               (void) setpgrp(0, pgrp);
  1925.           if (tpgrp > 0)
  1926.               tpgrp = 0;        /* gave tty away */
  1927.           /*
  1928.            * Nohup and nice apply only to TCOM's but it would be
  1929.            * nice (?!?) if you could say "nohup (foo;bar)"
  1930.  
  1931. --- 1089,1095 -----
  1932.               (void) setpgrp(0, pgrp);
  1933.           if (tpgrp > 0)
  1934.               tpgrp = 0;        /* gave tty away */
  1935. + #endif BSDJOBS
  1936.           /*
  1937.            * Nohup and nice apply only to TCOM's but it would be
  1938.            * nice (?!?) if you could say "nohup (foo;bar)"
  1939. *** sh.proc.h    Thu Jun  6 13:15:49 1985
  1940. --- /usr/src/local/tcsh/sh.proc.h    Mon Aug 17 21:32:40 1987
  1941. ***************
  1942. *** 30,35
  1943.       /* if a job is stopped/background p_jobid gives its pgrp */
  1944.       struct    timeval p_btime;    /* begin time */
  1945.       struct    timeval p_etime;    /* end time */
  1946.       struct    rusage p_rusage;
  1947.       char    *p_command;        /* first PMAXLEN chars of command */
  1948.   };
  1949.  
  1950. --- 30,36 -----
  1951.       /* if a job is stopped/background p_jobid gives its pgrp */
  1952.       struct    timeval p_btime;    /* begin time */
  1953.       struct    timeval p_etime;    /* end time */
  1954. + #ifndef OREO
  1955.       struct    rusage p_rusage;
  1956.   #endif    OREO
  1957.       char    *p_command;        /* first PMAXLEN chars of command */
  1958. ***************
  1959. *** 31,36
  1960.       struct    timeval p_btime;    /* begin time */
  1961.       struct    timeval p_etime;    /* end time */
  1962.       struct    rusage p_rusage;
  1963.       char    *p_command;        /* first PMAXLEN chars of command */
  1964.   };
  1965.   
  1966.  
  1967. --- 32,38 -----
  1968.       struct    timeval p_etime;    /* end time */
  1969.   #ifndef OREO
  1970.       struct    rusage p_rusage;
  1971. + #endif    OREO
  1972.       char    *p_command;        /* first PMAXLEN chars of command */
  1973.   };
  1974.   
  1975. *** sh.sem.c    Tue May 13 01:08:43 1986
  1976. --- /usr/src/local/tcsh/sh.sem.c    Thu Sep 24 15:04:35 1987
  1977. ***************
  1978. *** 187,192
  1979.                       (void) signal(SIGINT, SIG_IGN);
  1980.                       (void) signal(SIGQUIT, SIG_IGN);
  1981.                   }
  1982.                   if (wanttty > 0)
  1983.                       (void) ioctl(FSHTTY, TIOCSPGRP,
  1984.                           (char *)&pgrp);
  1985.  
  1986. --- 187,193 -----
  1987.                       (void) signal(SIGINT, SIG_IGN);
  1988.                       (void) signal(SIGQUIT, SIG_IGN);
  1989.                   }
  1990. + #ifdef BSDJOBS
  1991.                   if (wanttty > 0)
  1992.                       (void) ioctl(FSHTTY, TIOCSPGRP,
  1993.                           (char *)&pgrp);
  1994. ***************
  1995. *** 192,197
  1996.                           (char *)&pgrp);
  1997.                   if (wanttty >= 0 && tpgrp >= 0)
  1998.                       (void) setpgrp(0, pgrp);
  1999.                   if (tpgrp > 0)
  2000.                       tpgrp = 0;
  2001.                   if (t->t_dflg & FNOHUP)
  2002.  
  2003. --- 193,199 -----
  2004.                           (char *)&pgrp);
  2005.                   if (wanttty >= 0 && tpgrp >= 0)
  2006.                       (void) setpgrp(0, pgrp);
  2007. + #endif    BSDJOBS
  2008.                   if (tpgrp > 0)
  2009.                       tpgrp = 0;
  2010.                   if (t->t_dflg & FNOHUP)
  2011. *** sh.set.c    Thu Jun  6 13:15:54 1985
  2012. --- /usr/src/local/tcsh/sh.set.c    Thu Sep 24 15:03:28 1987
  2013. ***************
  2014. *** 81,87
  2015.   
  2016.               HIST = *p++;
  2017.               HISTSUB = *p;
  2018. !         } else if (eq(vp, "user"))
  2019.               setenv("USER", value(vp));
  2020.           else if (eq(vp, "term"))
  2021.               setenv("TERM", value(vp));
  2022.  
  2023. --- 81,87 -----
  2024.   
  2025.               HIST = *p++;
  2026.               HISTSUB = *p;
  2027. !         } else if (eq(vp, "user")) {
  2028.               setenv("USER", value(vp));
  2029.           } else if (eq(vp, "term")) {
  2030.               setenv("TERM", value(vp));
  2031. ***************
  2032. *** 83,89
  2033.               HISTSUB = *p;
  2034.           } else if (eq(vp, "user"))
  2035.               setenv("USER", value(vp));
  2036. !         else if (eq(vp, "term"))
  2037.               setenv("TERM", value(vp));
  2038.           else if (eq(vp, "home"))
  2039.               setenv("HOME", value(vp));
  2040.  
  2041. --- 83,89 -----
  2042.               HISTSUB = *p;
  2043.           } else if (eq(vp, "user")) {
  2044.               setenv("USER", value(vp));
  2045. !         } else if (eq(vp, "term")) {
  2046.               setenv("TERM", value(vp));
  2047.               ed_Init(); /* reset the editor */
  2048.           } else if (eq(vp, "home")) {
  2049. ***************
  2050. *** 85,91
  2051.               setenv("USER", value(vp));
  2052.           else if (eq(vp, "term"))
  2053.               setenv("TERM", value(vp));
  2054. !         else if (eq(vp, "home"))
  2055.               setenv("HOME", value(vp));
  2056.   #ifdef FILEC
  2057.           else if (eq(vp, "filec"))
  2058.  
  2059. --- 85,92 -----
  2060.               setenv("USER", value(vp));
  2061.           } else if (eq(vp, "term")) {
  2062.               setenv("TERM", value(vp));
  2063. !             ed_Init(); /* reset the editor */
  2064. !         } else if (eq(vp, "home")) {
  2065.               setenv("HOME", value(vp));
  2066.           }
  2067.       } while (p = *v++);
  2068. ***************
  2069. *** 87,96
  2070.               setenv("TERM", value(vp));
  2071.           else if (eq(vp, "home"))
  2072.               setenv("HOME", value(vp));
  2073. ! #ifdef FILEC
  2074. !         else if (eq(vp, "filec"))
  2075. !             filec = 1;
  2076. ! #endif
  2077.       } while (p = *v++);
  2078.   }
  2079.   
  2080.  
  2081. --- 88,94 -----
  2082.               ed_Init(); /* reset the editor */
  2083.           } else if (eq(vp, "home")) {
  2084.               setenv("HOME", value(vp));
  2085. !         }
  2086.       } while (p = *v++);
  2087.   }
  2088.   
  2089. ***************
  2090. *** 435,444
  2091.           HIST = '!';
  2092.           HISTSUB = '^';
  2093.       }
  2094. - #ifdef FILEC
  2095. -     if (adrof("filec") == 0)
  2096. -         filec = 0;
  2097. - #endif
  2098.   }
  2099.   
  2100.   unset1(v, head)
  2101.  
  2102. --- 433,438 -----
  2103.           HIST = '!';
  2104.           HISTSUB = '^';
  2105.       }
  2106.   }
  2107.   
  2108.   unset1(v, head)
  2109. *** sh.time.c    Tue May 13 01:07:31 1986
  2110. --- /usr/src/local/tcsh/sh.time.c    Mon Aug 17 21:32:45 1987
  2111. ***************
  2112. *** 16,21
  2113.   
  2114.   settimes()
  2115.   {
  2116.       struct rusage ruch;
  2117.   
  2118.       (void) gettimeofday(&time0, (struct timezone *)0);
  2119.  
  2120. --- 16,22 -----
  2121.   
  2122.   settimes()
  2123.   {
  2124. + #ifndef OREO
  2125.       struct rusage ruch;
  2126.   #endif
  2127.   
  2128. ***************
  2129. *** 17,22
  2130.   settimes()
  2131.   {
  2132.       struct rusage ruch;
  2133.   
  2134.       (void) gettimeofday(&time0, (struct timezone *)0);
  2135.       (void) getrusage(RUSAGE_SELF, &ru0);
  2136.  
  2137. --- 18,24 -----
  2138.   {
  2139.   #ifndef OREO
  2140.       struct rusage ruch;
  2141. + #endif
  2142.   
  2143.       (void) gettimeofday(&time0, (struct timezone *)0);
  2144.   #ifndef    OREO
  2145. ***************
  2146. *** 19,24
  2147.       struct rusage ruch;
  2148.   
  2149.       (void) gettimeofday(&time0, (struct timezone *)0);
  2150.       (void) getrusage(RUSAGE_SELF, &ru0);
  2151.       (void) getrusage(RUSAGE_CHILDREN, &ruch);
  2152.       ruadd(&ru0, &ruch);
  2153.  
  2154. --- 21,27 -----
  2155.   #endif
  2156.   
  2157.       (void) gettimeofday(&time0, (struct timezone *)0);
  2158. + #ifndef    OREO
  2159.       (void) getrusage(RUSAGE_SELF, &ru0);
  2160.       (void) getrusage(RUSAGE_CHILDREN, &ruch);
  2161.       ruadd(&ru0, &ruch);
  2162. ***************
  2163. *** 22,27
  2164.       (void) getrusage(RUSAGE_SELF, &ru0);
  2165.       (void) getrusage(RUSAGE_CHILDREN, &ruch);
  2166.       ruadd(&ru0, &ruch);
  2167.   }
  2168.   
  2169.   /*
  2170.  
  2171. --- 25,31 -----
  2172.       (void) getrusage(RUSAGE_SELF, &ru0);
  2173.       (void) getrusage(RUSAGE_CHILDREN, &ruch);
  2174.       ruadd(&ru0, &ruch);
  2175. + #endif OREO
  2176.   }
  2177.   
  2178.   /*
  2179. ***************
  2180. *** 30,35
  2181.    */
  2182.   dotime()
  2183.   {
  2184.       struct timeval timedol;
  2185.       struct rusage ru1, ruch;
  2186.   
  2187.  
  2188. --- 34,40 -----
  2189.    */
  2190.   dotime()
  2191.   {
  2192. + #ifndef OREO
  2193.       struct timeval timedol;
  2194.       struct rusage ru1, ruch;
  2195.   
  2196. ***************
  2197. *** 38,43
  2198.       ruadd(&ru1, &ruch);
  2199.       (void) gettimeofday(&timedol, (struct timezone *)0);
  2200.       prusage(&ru0, &ru1, &timedol, &time0);
  2201.   }
  2202.   
  2203.   /*
  2204.  
  2205. --- 43,49 -----
  2206.       ruadd(&ru1, &ruch);
  2207.       (void) gettimeofday(&timedol, (struct timezone *)0);
  2208.       prusage(&ru0, &ru1, &timedol, &time0);
  2209. + #endif
  2210.   }
  2211.   
  2212.   /*
  2213. ***************
  2214. *** 57,62
  2215.       (void) setpriority(PRIO_PROCESS, 0, nval);
  2216.   }
  2217.   
  2218.   ruadd(ru, ru2)
  2219.       register struct rusage *ru, *ru2;
  2220.   {
  2221.  
  2222. --- 63,69 -----
  2223.       (void) setpriority(PRIO_PROCESS, 0, nval);
  2224.   }
  2225.   
  2226. + #ifndef OREO
  2227.   ruadd(ru, ru2)
  2228.       register struct rusage *ru, *ru2;
  2229.   {
  2230. ***************
  2231. *** 155,160
  2232.       }
  2233.       putchar('\n');
  2234.   }
  2235.   
  2236.   pdeltat(t1, t0)
  2237.       struct timeval *t1, *t0;
  2238.  
  2239. --- 162,168 -----
  2240.       }
  2241.       putchar('\n');
  2242.   }
  2243. + #endif
  2244.   
  2245.   pdeltat(t1, t0)
  2246.       struct timeval *t1, *t0;
  2247. *** Makefile    Thu Sep 24 15:24:33 1987
  2248. --- /usr/src/local/tcsh/Makefile    Mon Aug 17 21:53:45 1987
  2249. ***************
  2250. *** 37,43
  2251.   
  2252.   # on some machines, the alloc.c works.  On others, it dosn't.  Besides, 
  2253.   # nmalloc is much faster...
  2254. ! ALLOC=nmalloc.o
  2255.   
  2256.   SHOBJS=    sh.o sh.dir.o sh.dol.o sh.err.o sh.exec.o \
  2257.       sh.exp.o sh.func.o sh.glob.o sh.hist.o sh.init.o sh.lex.o sh.misc.o \
  2258.  
  2259. --- 37,43 -----
  2260.   
  2261.   # on some machines, the alloc.c works.  On others, it dosn't.  Besides, 
  2262.   # nmalloc is much faster...
  2263. ! ALLOC=alloc.o
  2264.   
  2265.   SHOBJS=    sh.o sh.char.o sh.dir.o sh.dol.o sh.err.o \
  2266.       sh.exec.o sh.exp.o sh.file.o sh.func.o sh.glob.o sh.hist.o sh.init.o \
  2267. ***************
  2268. *** 39,47
  2269.   # nmalloc is much faster...
  2270.   ALLOC=nmalloc.o
  2271.   
  2272. ! SHOBJS=    sh.o sh.dir.o sh.dol.o sh.err.o sh.exec.o \
  2273. !     sh.exp.o sh.func.o sh.glob.o sh.hist.o sh.init.o sh.lex.o sh.misc.o \
  2274. !     sh.parse.o sh.print.o sh.proc.o sh.sem.o sh.set.o sh.sig.o sh.time.o
  2275.   
  2276.   TWOBJS=    tw.help.o tw.init.o tw.parse.o tw.spell.o
  2277.   
  2278.  
  2279. --- 39,48 -----
  2280.   # nmalloc is much faster...
  2281.   ALLOC=alloc.o
  2282.   
  2283. ! SHOBJS=    sh.o sh.char.o sh.dir.o sh.dol.o sh.err.o \
  2284. !     sh.exec.o sh.exp.o sh.file.o sh.func.o sh.glob.o sh.hist.o sh.init.o \
  2285. !     sh.lex.o sh.misc.o sh.parse.o sh.print.o sh.proc.o sh.sem.o sh.set.o \
  2286. !     sh.time.o
  2287.   
  2288.   TWOBJS=    tw.help.o tw.init.o tw.parse.o tw.spell.o
  2289.   
  2290. ***************
  2291. *** 61,67
  2292.       rm -f tcsh.ps
  2293.       -ptroff -man tcsh.1 > tcsh.ps
  2294.   
  2295. ! ${SHOBJS}: sh.h sh.local.h
  2296.   
  2297.   ${TWOBJS}: sh.h sh.local.h tw.h
  2298.   
  2299.  
  2300. --- 62,68 -----
  2301.       rm -f tcsh.ps
  2302.       -ptroff -man tcsh.1 > tcsh.ps
  2303.   
  2304. ! # ${SHOBJS}: sh.h sh.local.h
  2305.   
  2306.   ${TWOBJS}: sh.h sh.local.h tw.h
  2307.   
  2308. ***************
  2309. *** 124,126
  2310.   
  2311.   tags:    /tmp
  2312.       ${CTAGS} sh*.c
  2313.  
  2314. --- 125,148 -----
  2315.   
  2316.   tags:    /tmp
  2317.       ${CTAGS} sh*.c
  2318. + sh.o: sh.h sh.local.h sh.char.h
  2319. + sh.char.o: sh.char.h
  2320. + sh.dir.o: sh.h sh.local.h sh.dir.h
  2321. + sh.dol.o: sh.h sh.local.h sh.char.h
  2322. + sh.err.o: sh.h sh.local.h sh.char.h
  2323. + sh.exec.o: sh.h sh.local.h sh.char.h
  2324. + sh.exp.o: sh.h sh.local.h sh.char.h
  2325. + sh.file.o: sh.h sh.local.h sh.char.h
  2326. + sh.func.o: sh.h sh.local.h sh.char.h
  2327. + sh.glob.o: sh.h sh.local.h sh.char.h
  2328. + sh.hist.o: sh.h sh.local.h sh.char.h
  2329. + sh.init.o: sh.local.h
  2330. + sh.lex.o: sh.h sh.local.h sh.char.h
  2331. + sh.misc.o: sh.h sh.local.h sh.char.h
  2332. + sh.parse.o: sh.h sh.local.h sh.char.h
  2333. + sh.print.o: sh.h sh.local.h sh.char.h
  2334. + sh.proc.o: sh.h sh.local.h sh.dir.h sh.proc.h sh.char.h
  2335. + sh.sem.o: sh.h sh.local.h sh.proc.h sh.char.h
  2336. + sh.set.o: sh.h sh.local.h sh.char.h
  2337. + sh.time.o: sh.h sh.local.h sh.char.h
  2338. *** ed.init.c    Thu Sep 24 15:24:43 1987
  2339. --- /usr/src/local/tcsh/ed.init.c    Mon Aug 31 09:26:09 1987
  2340. ***************
  2341. *** 86,92
  2342.       nlc.t_lnextc = CTRL(v);    /* literal next character */
  2343.   
  2344.   #  ifdef SIGWINCH
  2345. !     sigset(SIGWINCH, window_change); /* for window systems */
  2346.   #  endif
  2347.   # endif OREO
  2348.   #else SVID
  2349.  
  2350. --- 86,92 -----
  2351.       nlc.t_lnextc = CTRL(v);    /* literal next character */
  2352.   
  2353.   #  ifdef SIGWINCH
  2354. !     signal(SIGWINCH, window_change); /* for window systems */
  2355.   #  endif
  2356.   # endif OREO
  2357.   #else SVID
  2358. ***************
  2359. *** 135,141
  2360.       nlc.t_lnextc = CTRL(v);    /* literal next character */
  2361.   
  2362.   # ifdef SIGWINCH
  2363. !     sigset(SIGWINCH, window_change); /* for window systems */
  2364.   # endif
  2365.   #endif SVID
  2366.       }
  2367.  
  2368. --- 135,141 -----
  2369.       nlc.t_lnextc = CTRL(v);    /* literal next character */
  2370.   
  2371.   # ifdef SIGWINCH
  2372. !     signal(SIGWINCH, window_change); /* for window systems */
  2373.   # endif
  2374.   #endif SVID
  2375.       }
  2376. ***************
  2377. *** 190,196
  2378.       }
  2379.   
  2380.       xb.sg_erase = '\177';    /* del prev. char == DEL */
  2381. !     xb.sg_kill = CTRL(w);    /* special case of del region */
  2382.   
  2383.       xtc.t_intrc = CTRL(c);    /* SIGINTR */
  2384.       xtc.t_quitc = CTRL(\\);    /* SIGQUIT */
  2385.  
  2386. --- 190,196 -----
  2387.       }
  2388.   
  2389.       xb.sg_erase = '\177';    /* del prev. char == DEL */
  2390. !     xb.sg_kill = CTRL(u);    /* special case of del region */
  2391.   
  2392.       xtc.t_intrc = CTRL(c);    /* SIGINTR */
  2393.       xtc.t_quitc = CTRL(\\);    /* SIGQUIT */
  2394. *** ed.inputl.c    Thu Sep 24 15:24:45 1987
  2395. --- /usr/src/local/tcsh/ed.inputl.c    Thu Sep 17 23:24:16 1987
  2396. ***************
  2397. *** 212,218
  2398.   
  2399.       hp = Histlist.Hnext;
  2400.       if (hp == (struct Hist *)0) {
  2401. !     printf ("no hp\n");
  2402.       Beep();
  2403.       return;
  2404.       }
  2405.  
  2406. --- 212,218 -----
  2407.   
  2408.       hp = Histlist.Hnext;
  2409.       if (hp == (struct Hist *)0) {
  2410. !     printf ("No history pointer, probably no history\n");
  2411.       Beep();
  2412.       return;
  2413.       }
  2414. *** ed.screen.c    Thu Sep 24 15:25:04 1987
  2415. --- /usr/src/local/tcsh/ed.screen.c    Mon Aug 17 23:51:23 1987
  2416. ***************
  2417. *** 55,61
  2418.   
  2419.       if (where > TermV) {
  2420.   #ifdef DEBUG_SCREEN
  2421. !     printf ("MoveToLine: where is riduculous: %d\r\n", where);
  2422.       flush();
  2423.   #endif
  2424.       return;
  2425.  
  2426. --- 55,61 -----
  2427.   
  2428.       if (where > TermV) {
  2429.   #ifdef DEBUG_SCREEN
  2430. !     printf ("MoveToLine: where is ridiculous: %d\r\n", where);
  2431.       flush();
  2432.   #endif
  2433.       return;
  2434. ***************
  2435. *** 240,245
  2436.       char *area = buffer;
  2437.       char *MyTerm;
  2438.       char *getenv();
  2439.   
  2440.   #ifdef SIGWINCH
  2441.       sighold(SIGWINCH);        /* don't want to confuse things here */
  2442.  
  2443. --- 240,246 -----
  2444.       char *area = buffer;
  2445.       char *MyTerm;
  2446.       char *getenv();
  2447. +     int    omask;
  2448.   
  2449.   #ifdef SIGWINCH
  2450.       omask = sighold(SIGWINCH);        /* don't want to confuse things here */
  2451. ***************
  2452. *** 242,248
  2453.       char *getenv();
  2454.   
  2455.   #ifdef SIGWINCH
  2456. !     sighold(SIGWINCH);        /* don't want to confuse things here */
  2457.   #endif
  2458.   
  2459.       MyTerm = getenv("TERM");
  2460.  
  2461. --- 243,249 -----
  2462.       int    omask;
  2463.   
  2464.   #ifdef SIGWINCH
  2465. !     omask = sighold(SIGWINCH);        /* don't want to confuse things here */
  2466.   #endif
  2467.   
  2468.       MyTerm = getenv("TERM");
  2469. ***************
  2470. *** 355,361
  2471.       ClearDisp();
  2472.   
  2473.   #ifdef SIGWINCH
  2474. !     sigrelse(SIGWINCH);        /* can change it again */
  2475.   #endif
  2476.   }
  2477.   
  2478.  
  2479. --- 356,362 -----
  2480.       ClearDisp();
  2481.   
  2482.   #ifdef SIGWINCH
  2483. !     sigsetmask(omask);
  2484.   #endif
  2485.   }
  2486.   
  2487. ***************
  2488. *** 396,401
  2489.       ClearDisp();
  2490.   
  2491.   #ifdef SIGWINCH
  2492. !     sigrelse(SIGWINCH);        /* can change it again */
  2493.   #endif
  2494.   }
  2495.  
  2496. --- 397,403 -----
  2497.       ClearDisp();
  2498.   
  2499.   #ifdef SIGWINCH
  2500. !     (void) sigsetmask(sigblock(0) & ~sigmask(SIGWINCH));
  2501.   #endif
  2502.   }
  2503.   
  2504. ***************
  2505. *** 399,401
  2506.       sigrelse(SIGWINCH);        /* can change it again */
  2507.   #endif
  2508.   }
  2509.  
  2510. --- 400,409 -----
  2511.       (void) sigsetmask(sigblock(0) & ~sigmask(SIGWINCH));
  2512.   #endif
  2513.   }
  2514. *** pwprintf.c    Thu Sep 24 15:25:07 1987
  2515. --- /usr/src/local/tcsh/pwprintf.c    Mon Aug 17 22:24:47 1987
  2516. ***************
  2517. *** 1,7
  2518.   /* A public-domain, minimal printf routine that prints through the putchar()
  2519.      routine.  Feel free to use for anything...  -- 7/17/87 Paul Placeway */
  2520.   
  2521. ! #include <ctype.h>
  2522.   #include <varargs.h>
  2523.   
  2524.   /* use varargs since it's the RIGHT WAY, and assuming things about parameters
  2525.  
  2526. --- 1,9 -----
  2527.   /* A public-domain, minimal printf routine that prints through the putchar()
  2528.      routine.  Feel free to use for anything...  -- 7/17/87 Paul Placeway */
  2529.   
  2530. ! #include "sh.h"
  2531. ! /*#include <ctype.h>*/
  2532. ! #include "sh.char.h"
  2533.   #include <varargs.h>
  2534.   
  2535.   /* use varargs since it's the RIGHT WAY, and assuming things about parameters
  2536. *** sh.nfunc.c    Thu Sep 24 15:24:30 1987
  2537. --- /usr/src/local/tcsh/sh.nfunc.c    Mon Aug 17 23:19:24 1987
  2538. ***************
  2539. *** 7,12
  2540.   #include "tw.h"
  2541.   
  2542.   #include <sys/ioctl.h>
  2543.   
  2544.   static int parsekey();
  2545.   static char *unparsekey();
  2546.  
  2547. --- 7,13 -----
  2548.   #include "tw.h"
  2549.   
  2550.   #include <sys/ioctl.h>
  2551. + #include "sh.char.h"
  2552.   
  2553.   static int parsekey();
  2554.   static char *unparsekey();
  2555. ***************
  2556. *** 11,16
  2557.   static int parsekey();
  2558.   static char *unparsekey();
  2559.   
  2560.   /*
  2561.    * Tops-C shell
  2562.    */
  2563.  
  2564. --- 12,19 -----
  2565.   static int parsekey();
  2566.   static char *unparsekey();
  2567.   
  2568. + extern    int    tglob(), trim();
  2569.   /*
  2570.    * Tops-C shell
  2571.    */
  2572. ***************
  2573. *** 344,350
  2574.       struct stat statb;
  2575.       
  2576.       if (setintr)
  2577. !     sigrelse(SIGINT);
  2578.   
  2579.       if (*++v == NULL) {
  2580.       t_search("", (char *)0, LIST, 0, 0);
  2581.  
  2582. --- 347,353 -----
  2583.       struct stat statb;
  2584.       
  2585.       if (setintr)
  2586. !         (void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
  2587.   
  2588.       if (*++v == NULL) {
  2589.       t_search("", (char *)0, LIST, 0, 0);
  2590. ***************
  2591. *** 356,362
  2592.       if (v == 0)
  2593.           bferr("No match");
  2594.       } else
  2595. !     scan(v, trim);
  2596.       k = 0;
  2597.       if (*(v+1))
  2598.       f = 1;
  2599.  
  2600. --- 359,368 -----
  2601.       if (v == 0)
  2602.           bferr("No match");
  2603.       } else
  2604. !         /*
  2605. !         scan(v, trim);
  2606. !         */
  2607. !         trim(v);
  2608.       k = 0;
  2609.       if (*(v+1))
  2610.       f = 1;
  2611. *** tw.h    Thu Sep 24 15:25:11 1987
  2612. --- /usr/src/local/tcsh/tw.h    Mon Aug 17 23:15:06 1987
  2613. ***************
  2614. *** 1,3
  2615.   #ifdef MAKE_TWENEX
  2616.   
  2617.   #define FREE_ITEMS(items,num)\
  2618.  
  2619. --- 1,4 -----
  2620.   #ifdef MAKE_TWENEX
  2621.   
  2622.   #define FREE_ITEMS(items,num)\
  2623. ***************
  2624. *** 2,8
  2625.   
  2626.   #define FREE_ITEMS(items,num)\
  2627.   {\
  2628. !     sighold (SIGINT);\
  2629.       free_items (items,num);\
  2630.       items = NULL;\
  2631.       sigrelse (SIGINT);\
  2632.  
  2633. --- 3,10 -----
  2634.   
  2635.   #define FREE_ITEMS(items,num)\
  2636.   {\
  2637. !     int    omask;\
  2638. !     omask = sighold (SIGINT);\
  2639.       free_items (items,num);\
  2640.       items = NULL;\
  2641.       sigsetmask(omask);\
  2642. ***************
  2643. *** 5,11
  2644.       sighold (SIGINT);\
  2645.       free_items (items,num);\
  2646.       items = NULL;\
  2647. !     sigrelse (SIGINT);\
  2648.   }
  2649.   
  2650.   #define FREE_DIR(fd)\
  2651.  
  2652. --- 7,13 -----
  2653.       omask = sighold (SIGINT);\
  2654.       free_items (items,num);\
  2655.       items = NULL;\
  2656. !     sigsetmask(omask);\
  2657.   }
  2658.   
  2659.   #define FREE_DIR(fd)\
  2660. ***************
  2661. *** 10,16
  2662.   
  2663.   #define FREE_DIR(fd)\
  2664.   {\
  2665. !     sighold (SIGINT);\
  2666.       closedir (fd);\
  2667.       fd = NULL;\
  2668.       sigrelse (SIGINT);\
  2669.  
  2670. --- 12,19 -----
  2671.   
  2672.   #define FREE_DIR(fd)\
  2673.   {\
  2674. !     int    omask;\
  2675. !     omask = sighold (SIGINT);\
  2676.       closedir (fd);\
  2677.       fd = NULL;\
  2678.       sigsetmask(omask);\
  2679. ***************
  2680. *** 13,19
  2681.       sighold (SIGINT);\
  2682.       closedir (fd);\
  2683.       fd = NULL;\
  2684. !     sigrelse (SIGINT);\
  2685.   }
  2686.   
  2687.   #define TRUE        1
  2688.  
  2689. --- 16,22 -----
  2690.       omask = sighold (SIGINT);\
  2691.       closedir (fd);\
  2692.       fd = NULL;\
  2693. !     sigsetmask(omask);\
  2694.   }
  2695.   
  2696.   #define TRUE        1
  2697. *** tw.help.c    Thu Sep 24 15:25:13 1987
  2698. --- /usr/src/local/tcsh/tw.help.c    Mon Aug 17 23:16:22 1987
  2699. ***************
  2700. *** 3,9
  2701.   #include "tw.h"
  2702.   #include "sh.h"
  2703.   
  2704.   /* actually look up and print documentation on a file.  Look down the path
  2705.      for an approiate file, then print it.  Note that the printing is NOT 
  2706.      PAGED.  This is because the function is NOT ment to look at manual pages,
  2707.  
  2708. --- 3,8 -----
  2709.   #include "tw.h"
  2710.   #include "sh.h"
  2711.   
  2712.   /* actually look up and print documentation on a file.  Look down the path
  2713.      for an appropriate file, then print it.  Note that the printing is NOT 
  2714.      PAGED.  This is because the function is NOT ment to look at manual pages,
  2715. ***************
  2716. *** 5,11
  2717.   
  2718.   
  2719.   /* actually look up and print documentation on a file.  Look down the path
  2720. !    for an approiate file, then print it.  Note that the printing is NOT 
  2721.      PAGED.  This is because the function is NOT ment to look at manual pages,
  2722.      it only does so if there is no .help file to look in. */
  2723.   
  2724.  
  2725. --- 4,10 -----
  2726.   #include "sh.h"
  2727.   
  2728.   /* actually look up and print documentation on a file.  Look down the path
  2729. !    for an appropriate file, then print it.  Note that the printing is NOT 
  2730.      PAGED.  This is because the function is NOT ment to look at manual pages,
  2731.      it only does so if there is no .help file to look in. */
  2732.   
  2733. *** tw.init.c    Thu Sep 24 15:25:15 1987
  2734. --- /usr/src/local/tcsh/tw.init.c    Thu Sep 24 15:45:32 1987
  2735. ***************
  2736. *** 120,125
  2737.       register char *cp;
  2738.       register struct biltins *bptr;
  2739.   
  2740.       for (bptr = bfunc; cp = bptr->bname; bptr++) {
  2741.       tw_add_comm_name (cp);
  2742.       }
  2743.  
  2744. --- 120,127 -----
  2745.       register char *cp;
  2746.       register struct biltins *bptr;
  2747.   
  2748. +     for (bptr = bfunc; bptr < &bfunc[nbfunc]; bptr++) {
  2749. + #ifdef    OUTDEF
  2750.       for (bptr = bfunc; cp = bptr->bname; bptr++) {
  2751.   #endif
  2752.       tw_add_comm_name (cp);
  2753. ***************
  2754. *** 121,126
  2755.       register struct biltins *bptr;
  2756.   
  2757.       for (bptr = bfunc; cp = bptr->bname; bptr++) {
  2758.       tw_add_comm_name (cp);
  2759.       }
  2760.   }
  2761.  
  2762. --- 123,129 -----
  2763.       for (bptr = bfunc; bptr < &bfunc[nbfunc]; bptr++) {
  2764.   #ifdef    OUTDEF
  2765.       for (bptr = bfunc; cp = bptr->bname; bptr++) {
  2766. + #endif
  2767.       tw_add_comm_name (cp);
  2768.       }
  2769.   }
  2770. ***************
  2771. *** 127,132
  2772.   
  2773.   tw_add_aliases ()
  2774.   {
  2775.       register struct varent *vp;
  2776.   
  2777.       vp = &aliases;
  2778.  
  2779. --- 130,161 -----
  2780.   
  2781.   tw_add_aliases ()
  2782.   {
  2783. +     register struct varent *p;
  2784. +     register struct varent *c;
  2785. +     p = &aliases;
  2786. +     for (;;) {
  2787. +         while (p->v_left)
  2788. +             p = p->v_left;
  2789. +     x:
  2790. +         if (p->v_parent == 0)        /* is it the header? */
  2791. +             return;
  2792. +         tw_add_comm_name(p->v_name);
  2793. +         if (p->v_right) {
  2794. +             p = p->v_right;
  2795. +             continue;
  2796. +         }
  2797. +         do {
  2798. +             c = p;
  2799. +             p = p->v_parent;
  2800. +         } while (p->v_right == c);
  2801. +         goto x;
  2802. +     }
  2803. + }
  2804. + #ifdef    OUTDEF
  2805. + tw_add_aliases ()
  2806. + {
  2807.       register struct varent *vp;
  2808.   
  2809.       vp = &aliases;
  2810. ***************
  2811. *** 136,138
  2812.       }
  2813.   
  2814.   }
  2815.  
  2816. --- 165,169 -----
  2817.       }
  2818.   
  2819.   }
  2820. + #endif
  2821. *** tw.parse.c    Thu Sep 24 15:25:19 1987
  2822. --- /usr/src/local/tcsh/tw.parse.c    Thu Sep 24 15:46:59 1987
  2823. ***************
  2824. *** 64,70
  2825.   /*  printf ("\ncmd_st:%s:\nword_start:%s:\n", cmd_st, word_start); */
  2826.                   /* for debugging */
  2827.       if (command == RECOGNIZE) {
  2828. !         search_ret = t_search (word, wp, command, space_left, is_a_cmd);
  2829.       if (InsertStr(wp) < 0)    /* put it in the input buffer */
  2830.           return 2;        /* error inserting */
  2831.       return search_ret;
  2832.  
  2833. --- 64,70 -----
  2834.   /*  printf ("\ncmd_st:%s:\nword_start:%s:\n", cmd_st, word_start); */
  2835.                   /* for debugging */
  2836.       if (command == RECOGNIZE) {
  2837. !     search_ret = t_search (word, wp, command, space_left, is_a_cmd);
  2838.       if (InsertStr(wp) < 0)    /* put it in the input buffer */
  2839.           return 2;        /* error inserting */
  2840.       return search_ret;
  2841. ***************
  2842. *** 200,206
  2843.       numitems = 0;
  2844.       if (dir_fd != NULL)
  2845.       FREE_DIR (dir_fd);
  2846.       looking_for_lognames = (*word == '~') && (index (word, '/') == NULL);
  2847.       looking_for_command &= (*word != '~') && (index (word, '/') == NULL);
  2848.   
  2849.  
  2850. --- 200,205 -----
  2851.       numitems = 0;
  2852.       if (dir_fd != NULL)
  2853.       FREE_DIR (dir_fd);
  2854.       looking_for_lognames = (*word == '~') && (index (word, '/') == NULL);
  2855.       looking_for_command &= (*word != '~') && (index (word, '/') == NULL);
  2856.   
  2857. ***************
  2858. *** 206,212
  2859.   
  2860.       dot_got = FALSE;
  2861.       stat (".", &dot_statb);
  2862.       if (looking_for_lognames) {            /* Looking for login names? */
  2863.       setpwent ();                /* Open passwd file */
  2864.       copyn (name, &word[1], MAXNAMLEN);    /* name sans ~ */
  2865.  
  2866. --- 205,210 -----
  2867.   
  2868.       dot_got = FALSE;
  2869.       stat (".", &dot_statb);
  2870.       if (looking_for_lognames) {            /* Looking for login names? */
  2871.       setpwent ();                /* Open passwd file */
  2872.       copyn (name, &word[1], MAXNAMLEN);    /* name sans ~ */
  2873. *** tw.spell.c    Thu Sep 24 15:24:53 1987
  2874. --- /usr/src/local/tcsh/tw.spell.c    Mon Aug 17 23:00:23 1987
  2875. ***************
  2876. *** 1,4
  2877. - #include "sh.h"
  2878.   #define MAKE_TWENEX
  2879.   #include "tw.h"
  2880.   
  2881.  
  2882. --- 1,3 -----
  2883.   #define MAKE_TWENEX
  2884.   #include "tw.h"
  2885.   
  2886.