home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume11 / tcsh / part05 < prev    next >
Internet Message Format  |  1987-08-10  |  50KB

  1. Path: uunet!rs
  2. From: rs@uunet.UU.NET (Rich Salz)
  3. Newsgroups: comp.sources.unix
  4. Subject: v10i005:  New version of T-shell, Part05/06
  5. Message-ID: <863@uunet.UU.NET>
  6. Date: 11 Aug 87 23:53:04 GMT
  7. Organization: UUNET Communications Services, Arlington, VA
  8. Lines: 2319
  9. Approved: rs@uunet.UU.NET
  10.  
  11. Submitted-by: Paul Placeway <osu-eddie!paul>
  12. Posting-number: Volume 10, Issue 5
  13. Archive-name: tcsh/Part05
  14.  
  15. # This is a shell archive.  Remove anything before this line
  16. # then unpack it by saving it in a file and typing "sh file"
  17. # (Files unpacked will be owned by you and have default permissions).
  18. # This archive contains the following files:
  19. #    ./DIFFS.2
  20. #
  21. if `test ! -s ./DIFFS.2`
  22. then
  23. echo "writing ./DIFFS.2"
  24. sed 's/^x//' > ./DIFFS.2 << '\Rogue\Monster\'
  25. x*** ../csh4.2/sh.glob.c    Tue Jun 23 12:13:49 1987
  26. x--- sh.glob.c    Sat Jul  4 12:10:23 1987
  27. x***************
  28. x*** 1,7
  29. x  static    char *sccsid = "@(#)sh.glob.c 4.5 7/3/83";
  30. x  
  31. x  #include "sh.h"
  32. x! #include <sys/dir.h>
  33. x  
  34. x  /*
  35. x   * C Shell
  36. x
  37. x--- 1,7 -----
  38. x  static    char *sccsid = "@(#)sh.glob.c 4.5 7/3/83";
  39. x  
  40. x  #include "sh.h"
  41. x! /* #include <sys/dir.h> */
  42. x  
  43. x  /*
  44. x   * C Shell
  45. x***************
  46. x*** 101,107
  47. x          sort();
  48. x  }
  49. x  
  50. x! sort()
  51. x  {
  52. x      register char **p1, **p2, *c;
  53. x      char **Gvp = &gargv[gargc];
  54. x
  55. x--- 101,109 -----
  56. x          sort();
  57. x  }
  58. x  
  59. x! static
  60. x! sortcmp(a, b)
  61. x! register char **a, **b;
  62. x  {
  63. x      if (!a)            /* check for NULL */
  64. x      return (b?1:0);
  65. x***************
  66. x*** 103,108
  67. x  
  68. x  sort()
  69. x  {
  70. x      register char **p1, **p2, *c;
  71. x      char **Gvp = &gargv[gargc];
  72. x  
  73. x
  74. x--- 105,125 -----
  75. x  sortcmp(a, b)
  76. x  register char **a, **b;
  77. x  {
  78. x+     if (!a)            /* check for NULL */
  79. x+     return (b?1:0);
  80. x+     if (!b)
  81. x+     return (-1);
  82. x+ 
  83. x+     if (!*a)            /* check for NULL */
  84. x+     return (*b?1:0);
  85. x+     if (!*b)
  86. x+     return (-1);
  87. x+ 
  88. x+     return (strcmp(*a, *b));
  89. x+ }
  90. x+ 
  91. x+ #ifdef COMMENT
  92. x+ This was in the sort() routine below.
  93. x      register char **p1, **p2, *c;
  94. x  
  95. x  
  96. x***************
  97. x*** 104,110
  98. x  sort()
  99. x  {
  100. x      register char **p1, **p2, *c;
  101. x-     char **Gvp = &gargv[gargc];
  102. x  
  103. x      p1 = sortbas;
  104. x      while (p1 < Gvp-1) {
  105. x
  106. x--- 121,126 -----
  107. x  #ifdef COMMENT
  108. x  This was in the sort() routine below.
  109. x      register char **p1, **p2, *c;
  110. x  
  111. x  
  112. x      p1 = sortbas;
  113. x***************
  114. x*** 106,111
  115. x      register char **p1, **p2, *c;
  116. x      char **Gvp = &gargv[gargc];
  117. x  
  118. x      p1 = sortbas;
  119. x      while (p1 < Gvp-1) {
  120. x          p2 = p1;
  121. x
  122. x--- 122,128 -----
  123. x  This was in the sort() routine below.
  124. x      register char **p1, **p2, *c;
  125. x  
  126. x+ 
  127. x      p1 = sortbas;
  128. x      while (p1 < Gvp-1) {    /* a BUBBLE SORT! how gross!! -- PWP */
  129. x          p2 = p1;
  130. x***************
  131. x*** 107,113
  132. x      char **Gvp = &gargv[gargc];
  133. x  
  134. x      p1 = sortbas;
  135. x!     while (p1 < Gvp-1) {
  136. x          p2 = p1;
  137. x          while (++p2 < Gvp)
  138. x              if (strcmp(*p1, *p2) > 0)
  139. x
  140. x--- 124,130 -----
  141. x  
  142. x  
  143. x      p1 = sortbas;
  144. x!     while (p1 < Gvp-1) {    /* a BUBBLE SORT! how gross!! -- PWP */
  145. x          p2 = p1;
  146. x          while (++p2 < Gvp)
  147. x              if (strcmp(*p1, *p2) > 0)
  148. x***************
  149. x*** 114,119
  150. x                  c = *p1, *p1 = *p2, *p2 = c;
  151. x          p1++;
  152. x      }
  153. x      sortbas = Gvp;
  154. x  }
  155. x  
  156. x
  157. x--- 131,145 -----
  158. x                  c = *p1, *p1 = *p2, *p2 = c;
  159. x          p1++;
  160. x      }
  161. x+ #endif
  162. x+ 
  163. x+ sort()                /* changed to use a qsort() 7/05/87 PWP */
  164. x+ {
  165. x+     char **Gvp = &gargv[gargc];
  166. x+ 
  167. x+     if (Gvp-sortbas > 1)
  168. x+         qsort (sortbas, Gvp-sortbas, sizeof (char *), sortcmp);
  169. x+ 
  170. x      sortbas = Gvp;
  171. x  }
  172. x  
  173. x***************
  174. x*** 126,131
  175. x  
  176. x      sgpathp = gpathp;
  177. x      cs = as;
  178. x      if (*cs == '~' && gpathp == gpath) {
  179. x          addpath('~');
  180. x          for (cs++; letter(*cs) || digit(*cs) || *cs == '-';)
  181. x
  182. x--- 152,176 -----
  183. x  
  184. x      sgpathp = gpathp;
  185. x      cs = as;
  186. x+     /*
  187. x+      * kfk - 17 Jan 1984 - stack hack
  188. x+      * allows user to get at arbitrary dir names in stack.
  189. x+      */
  190. x+     if (*cs == '=' && gpathp == gpath) {
  191. x+         addpath ('=');
  192. x+         if (digit (*++cs) || *cs == '-') {
  193. x+             int dig;
  194. x+             dig = (*cs == '-') ? -1 : *cs - '0';
  195. x+             cs++;
  196. x+             if (*cs && *cs != '/')
  197. x+                 error ("Stack hack: =<dig>{/path...}");
  198. x+             getstakd (gpath, dig, 1);
  199. x+                 /* last "1" = call error if needed */
  200. x+             gpathp = strend (gpath);
  201. x+         }
  202. x+     }
  203. x+     /* kfk - end stack hack change */
  204. x+ 
  205. x      if (*cs == '~' && gpathp == gpath) {
  206. x          addpath('~');
  207. x          for (cs++; letter(*cs) || digit(*cs) || *cs == '-';)
  208. x***************
  209. x*** 291,297
  210. x      register char *sentp;
  211. x      char sglobbed = globbed;
  212. x  
  213. x!     if (*s == '.' && *p != '.')
  214. x          return (0);
  215. x      sentp = entp;
  216. x      entp = s;
  217. x
  218. x--- 336,342 -----
  219. x      register char *sentp;
  220. x      char sglobbed = globbed;
  221. x  
  222. x!     if (*s == '.' && *p != '.') /* PWP: this makes [.]login != .login */
  223. x          return (0);
  224. x      sentp = entp;
  225. x      entp = s;
  226. x***************
  227. x*** 305,311
  228. x      register char *s, *p;
  229. x  {
  230. x      register int scc;
  231. x!     int ok, lc;
  232. x      char *sgpathp;
  233. x      struct stat stb;
  234. x      int c, cc;
  235. x
  236. x--- 350,356 -----
  237. x      register char *s, *p;
  238. x  {
  239. x      register int scc;
  240. x!     int ok, lc, notin;
  241. x      char *sgpathp;
  242. x      struct stat stb;
  243. x      int c, cc;
  244. x***************
  245. x*** 318,324
  246. x          case '{':
  247. x              return (execbrc(p - 1, s - 1));
  248. x  
  249. x!         case '[':
  250. x              ok = 0;
  251. x              lc = 077777;
  252. x              while (cc = *p++) {
  253. x
  254. x--- 363,370 -----
  255. x          case '{':
  256. x              return (execbrc(p - 1, s - 1));
  257. x  
  258. x!         case '[':    /* PWP -- BRACKET IS HERE!! */
  259. x!             if (!scc) return 0; /* if at end if string */
  260. x              ok = 0;
  261. x              lc = 077777;
  262. x              if (*p == '^') {
  263. x***************
  264. x*** 321,326
  265. x          case '[':
  266. x              ok = 0;
  267. x              lc = 077777;
  268. x              while (cc = *p++) {
  269. x                  if (cc == ']') {
  270. x                      if (ok)
  271. x
  272. x--- 367,377 -----
  273. x              if (!scc) return 0; /* if at end if string */
  274. x              ok = 0;
  275. x              lc = 077777;
  276. x+             if (*p == '^') {
  277. x+                 notin = 1;
  278. x+                 p++;
  279. x+             } else
  280. x+                 notin = 0;
  281. x              while (cc = *p++) {
  282. x                  if (cc == ']') {
  283. x                      if (notin) { /* PWP for not in list */
  284. x***************
  285. x*** 323,328
  286. x              lc = 077777;
  287. x              while (cc = *p++) {
  288. x                  if (cc == ']') {
  289. x                      if (ok)
  290. x                          break;
  291. x                      return (0);
  292. x
  293. x--- 374,385 -----
  294. x                  notin = 0;
  295. x              while (cc = *p++) {
  296. x                  if (cc == ']') {
  297. x+                     if (notin) { /* PWP for not in list */
  298. x+                         if (!ok)
  299. x+                         break;
  300. x+                         else
  301. x+                         return (0);
  302. x+                     } else {
  303. x                          if (ok)
  304. x                          break;
  305. x                          else
  306. x***************
  307. x*** 325,330
  308. x                  if (cc == ']') {
  309. x                      if (ok)
  310. x                          break;
  311. x                      return (0);
  312. x                  }
  313. x                  if (cc == '-') {
  314. x
  315. x--- 382,388 -----
  316. x                      } else {
  317. x                          if (ok)
  318. x                          break;
  319. x+                         else
  320. x                          return (0);
  321. x                      }
  322. x                  }
  323. x***************
  324. x*** 327,332
  325. x                          break;
  326. x                      return (0);
  327. x                  }
  328. x                  if (cc == '-') {
  329. x                      if (lc <= scc && scc <= *p++)
  330. x                          ok++;
  331. x
  332. x--- 385,391 -----
  333. x                          else
  334. x                          return (0);
  335. x                      }
  336. x+                 }
  337. x                  if (cc == '-') {
  338. x                      if (lc <= scc && scc <= *p++)
  339. x                          ok++;
  340. x***************
  341. x*** 331,337
  342. x                      if (lc <= scc && scc <= *p++)
  343. x                          ok++;
  344. x                  } else
  345. x!                     if (scc == (lc = cc))
  346. x                          ok++;
  347. x              }
  348. x              if (cc == 0)
  349. x
  350. x--- 390,396 -----
  351. x                      if (lc <= scc && scc <= *p++)
  352. x                          ok++;
  353. x                  } else
  354. x!                     if (scc && (scc == (lc = cc)))
  355. x                          ok++;
  356. x              }
  357. x              if (cc == 0)
  358. x***************
  359. x*** 389,395
  360. x      register char *s, *p;
  361. x  {
  362. x      register int scc;
  363. x!     int ok, lc;
  364. x      int c, cc;
  365. x  
  366. x      for (;;) {
  367. x
  368. x--- 448,454 -----
  369. x      register char *s, *p;
  370. x  {
  371. x      register int scc;
  372. x!     int ok, lc, notin;
  373. x      int c, cc;
  374. x  
  375. x      for (;;) {
  376. x***************
  377. x*** 396,402
  378. x          scc = *s++ & TRIM;
  379. x          switch (c = *p++) {
  380. x  
  381. x!         case '[':
  382. x              ok = 0;
  383. x              lc = 077777;
  384. x              while (cc = *p++) {
  385. x
  386. x--- 455,462 -----
  387. x          scc = *s++ & TRIM;
  388. x          switch (c = *p++) {
  389. x  
  390. x!         case '[':    /* PWP -- HERE TOO!! */
  391. x!             if (!scc) return 0; /* if at end if string */
  392. x              ok = 0;
  393. x              lc = 077777;
  394. x              if (*p == '^') {
  395. x***************
  396. x*** 399,404
  397. x          case '[':
  398. x              ok = 0;
  399. x              lc = 077777;
  400. x              while (cc = *p++) {
  401. x                  if (cc == ']') {
  402. x                      if (ok)
  403. x
  404. x--- 459,469 -----
  405. x              if (!scc) return 0; /* if at end if string */
  406. x              ok = 0;
  407. x              lc = 077777;
  408. x+             if (*p == '^') {
  409. x+                 notin = 1;
  410. x+                 p++;
  411. x+             } else
  412. x+                 notin = 0;
  413. x              while (cc = *p++) {
  414. x                  if (cc == ']') {
  415. x                      if (notin) { /* PWP for not in list */
  416. x***************
  417. x*** 401,406
  418. x              lc = 077777;
  419. x              while (cc = *p++) {
  420. x                  if (cc == ']') {
  421. x                      if (ok)
  422. x                          break;
  423. x                      return (0);
  424. x
  425. x--- 466,477 -----
  426. x                  notin = 0;
  427. x              while (cc = *p++) {
  428. x                  if (cc == ']') {
  429. x+                     if (notin) { /* PWP for not in list */
  430. x+                         if (!ok)
  431. x+                         break;
  432. x+                         else
  433. x+                         return (0);
  434. x+                     } else {
  435. x                          if (ok)
  436. x                          break;
  437. x                          else
  438. x***************
  439. x*** 403,408
  440. x                  if (cc == ']') {
  441. x                      if (ok)
  442. x                          break;
  443. x                      return (0);
  444. x                  }
  445. x                  if (cc == '-') {
  446. x
  447. x--- 474,480 -----
  448. x                      } else {
  449. x                          if (ok)
  450. x                          break;
  451. x+                         else
  452. x                          return (0);
  453. x                      }
  454. x                  }
  455. x***************
  456. x*** 405,410
  457. x                          break;
  458. x                      return (0);
  459. x                  }
  460. x                  if (cc == '-') {
  461. x                      if (lc <= scc && scc <= *p++)
  462. x                          ok++;
  463. x
  464. x--- 477,483 -----
  465. x                          else
  466. x                          return (0);
  467. x                      }
  468. x+                 }
  469. x                  if (cc == '-') {
  470. x                      if (lc <= scc && scc <= *p++)
  471. x                          ok++;
  472. x***************
  473. x*** 409,415
  474. x                      if (lc <= scc && scc <= *p++)
  475. x                          ok++;
  476. x                  } else
  477. x!                     if (scc == (lc = cc))
  478. x                          ok++;
  479. x              }
  480. x              if (cc == 0)
  481. x
  482. x--- 482,488 -----
  483. x                      if (lc <= scc && scc <= *p++)
  484. x                          ok++;
  485. x                  } else
  486. x!                     if (scc && (scc == (lc = cc)))
  487. x                          ok++;
  488. x              }
  489. x              if (cc == 0)
  490. x***************
  491. x*** 470,476
  492. x  
  493. x      while (p = *t++) {
  494. x          if (f == tglob)
  495. x!             if (*p == '~')
  496. x                  gflag |= 2;
  497. x              else if (eq(p, "{") || eq(p, "{}"))
  498. x                  continue;
  499. x
  500. x--- 543,550 -----
  501. x  
  502. x      while (p = *t++) {
  503. x          if (f == tglob)
  504. x!             /* added additional '=' test for stack hack */
  505. x!             if ((*p == '~') || (*p == '='))
  506. x                  gflag |= 2;
  507. x              else if (eq(p, "{") || eq(p, "{}"))
  508. x                  continue;
  509. x*** ../csh4.2/sh.h    Tue Jun 23 12:13:51 1987
  510. x--- sh.h    Thu Jul 16 14:02:22 1987
  511. x***************
  512. x*** 13,18
  513. x   * Jim Kulp, IIASA, Laxenburg Austria
  514. x   * April, 1980
  515. x   */
  516. x  #include <sys/param.h>
  517. x  #include <sys/stat.h>
  518. x  
  519. x
  520. x--- 13,21 -----
  521. x   * Jim Kulp, IIASA, Laxenburg Austria
  522. x   * April, 1980
  523. x   */
  524. x+ #ifdef SVID
  525. x+ #include <sys/types.h>
  526. x+ #endif
  527. x  #include <sys/param.h>
  528. x  #include <sys/stat.h>
  529. x  
  530. x***************
  531. x*** 22,27
  532. x  #include <setjmp.h>
  533. x  #include <signal.h>
  534. x  #include <sys/times.h>
  535. x  
  536. x  typedef    char    bool;
  537. x  
  538. x
  539. x--- 25,31 -----
  540. x  #include <setjmp.h>
  541. x  #include <signal.h>
  542. x  #include <sys/times.h>
  543. x+ #include <sys/ioctl.h>
  544. x  
  545. x  #ifndef SVID
  546. x  #include <sgtty.h>
  547. x***************
  548. x*** 23,28
  549. x  #include <signal.h>
  550. x  #include <sys/times.h>
  551. x  
  552. x  typedef    char    bool;
  553. x  
  554. x  #define    eq(a, b)    (strcmp(a, b) == 0)
  555. x
  556. x--- 27,71 -----
  557. x  #include <sys/times.h>
  558. x  #include <sys/ioctl.h>
  559. x  
  560. x+ #ifndef SVID
  561. x+ #include <sgtty.h>
  562. x+ #include <sys/dir.h>
  563. x+ #else SVID
  564. x+ # ifdef OREO
  565. x+ #include <sgtty.h>
  566. x+ #include <sys/dir.h>
  567. x+ # else OREO
  568. x+ #include "dir.h"
  569. x+ # endif OREO
  570. x+ #endif SVID
  571. x+ 
  572. x+ #include <ctype.h>
  573. x+ #include <pwd.h>
  574. x+ 
  575. x+ #ifdef SVID
  576. x+ # ifndef pyr
  577. x+ #include <time.h>
  578. x+ # endif pyr
  579. x+ #include <termio.h>
  580. x+ #endif
  581. x+ 
  582. x+ /*
  583. x+  * kfk 26 Jan 1984 - for login watch functions.
  584. x+  */
  585. x+ #include <utmp.h>
  586. x+ struct who {
  587. x+     struct who *w_next;
  588. x+     struct who *w_prev;
  589. x+     char w_name[10];
  590. x+     char w_new[10];
  591. x+     char w_tty[10];
  592. x+     int w_status;
  593. x+ };
  594. x+ #define ONLINE        01
  595. x+ #define OFFLINE        02
  596. x+ #define CHANGED        04
  597. x+ #define ANNOUNCE    010
  598. x+ /* kfk - end change */
  599. x  typedef    char    bool;
  600. x  
  601. x  /* kfk - additions to support scheduled commands */
  602. x***************
  603. x*** 25,30
  604. x  
  605. x  typedef    char    bool;
  606. x  
  607. x  #define    eq(a, b)    (strcmp(a, b) == 0)
  608. x  
  609. x  /*
  610. x
  611. x--- 68,82 -----
  612. x  /* kfk - end change */
  613. x  typedef    char    bool;
  614. x  
  615. x+ /* kfk - additions to support scheduled commands */
  616. x+ struct sched_event {
  617. x+     struct    sched_event    *t_next;
  618. x+     long            t_when;
  619. x+     char            **t_lex;
  620. x+ };
  621. x+ extern    long    time();
  622. x+ /* kfk - end change */
  623. x+ 
  624. x  #define    eq(a, b)    (strcmp(a, b) == 0)
  625. x  
  626. x  /*
  627. x***************
  628. x*** 65,70
  629. x  int    errno;            /* Error from C library routines */
  630. x  char    *shtemp;        /* Temp name for << shell files in /tmp */
  631. x  struct    timeval time0;        /* Time at which the shell started */
  632. x  struct    rusage ru0;
  633. x  
  634. x  /*
  635. x
  636. x--- 117,123 -----
  637. x  int    errno;            /* Error from C library routines */
  638. x  char    *shtemp;        /* Temp name for << shell files in /tmp */
  639. x  struct    timeval time0;        /* Time at which the shell started */
  640. x+ #ifndef OREO
  641. x  struct    rusage ru0;
  642. x  #endif OREO
  643. x  
  644. x***************
  645. x*** 66,71
  646. x  char    *shtemp;        /* Temp name for << shell files in /tmp */
  647. x  struct    timeval time0;        /* Time at which the shell started */
  648. x  struct    rusage ru0;
  649. x  
  650. x  /*
  651. x   * Miscellany
  652. x
  653. x--- 119,125 -----
  654. x  struct    timeval time0;        /* Time at which the shell started */
  655. x  #ifndef OREO
  656. x  struct    rusage ru0;
  657. x+ #endif OREO
  658. x  
  659. x  /*
  660. x   * Miscellany
  661. x***************
  662. x*** 79,84
  663. x  int    opgrp;            /* Initial pgrp and tty pgrp */
  664. x  int    oldisc;            /* Initial line discipline or -1 */
  665. x  struct    tms shtimes;        /* shell and child times for process timing */
  666. x  
  667. x  /*
  668. x   * These are declared here because they want to be
  669. x
  670. x--- 133,141 -----
  671. x  int    opgrp;            /* Initial pgrp and tty pgrp */
  672. x  int    oldisc;            /* Initial line discipline or -1 */
  673. x  struct    tms shtimes;        /* shell and child times for process timing */
  674. x+ char PromptBuf[256];        /* buffer for the actual printed prompt.
  675. x+                    this is used in tenex.c and sh.c for
  676. x+                    pegets.c */
  677. x  
  678. x  /*
  679. x   * These are declared here because they want to be
  680. x***************
  681. x*** 358,363
  682. x      struct    wordent Hlex;
  683. x      int    Hnum;
  684. x      int    Href;
  685. x      struct    Hist *Hnext;
  686. x  } Histlist;
  687. x  
  688. x
  689. x--- 415,421 -----
  690. x      struct    wordent Hlex;
  691. x      int    Hnum;
  692. x      int    Href;
  693. x+     long    Htime;
  694. x      struct    Hist *Hnext;
  695. x  } Histlist;
  696. x  
  697. x***************
  698. x*** 398,403
  699. x  char    *globone();
  700. x  struct    biltins *isbfunc();
  701. x  char    **glob();
  702. x  char    *operate();
  703. x  int    phup();
  704. x  int    pintr();
  705. x
  706. x--- 456,462 -----
  707. x  char    *globone();
  708. x  struct    biltins *isbfunc();
  709. x  char    **glob();
  710. x+ struct    tm *localtime();
  711. x  char    *operate();
  712. x  int    phup();
  713. x  int    pintr();
  714. x*** ../csh4.2/sh.hist.c    Tue Jun 23 12:13:51 1987
  715. x--- sh.hist.c    Fri Jul 17 13:59:16 1987
  716. x***************
  717. x*** 44,49
  718. x      register struct Hist *np;
  719. x  
  720. x      np = (struct Hist *) calloc(1, sizeof *np);
  721. x      np->Hnum = np->Href = event;
  722. x      if (docopy)
  723. x          copylex(&np->Hlex, lp);
  724. x
  725. x--- 44,50 -----
  726. x      register struct Hist *np;
  727. x  
  728. x      np = (struct Hist *) calloc(1, sizeof *np);
  729. x+     time(&(np->Htime));
  730. x      np->Hnum = np->Href = event;
  731. x      if (docopy)
  732. x          copylex(&np->Hlex, lp);
  733. x***************
  734. x*** 119,124
  735. x      register struct Hist *hp;
  736. x      int hflg;
  737. x  {
  738. x  
  739. x      if (hflg == 0)
  740. x          printf("%6d\t", hp->Hnum);
  741. x
  742. x--- 120,127 -----
  743. x      register struct Hist *hp;
  744. x      int hflg;
  745. x  {
  746. x+     struct tm *t;
  747. x+     char ampm = 'a';
  748. x  
  749. x      if (hflg == 0)
  750. x      {
  751. x***************
  752. x*** 121,126
  753. x  {
  754. x  
  755. x      if (hflg == 0)
  756. x          printf("%6d\t", hp->Hnum);
  757. x      prlex(&hp->Hlex);
  758. x  }
  759. x
  760. x--- 124,130 -----
  761. x      char ampm = 'a';
  762. x  
  763. x      if (hflg == 0)
  764. x+     {
  765. x          printf("%6d\t", hp->Hnum);
  766. x          t = localtime(&hp->Htime);
  767. x          if (t->tm_hour >= 12)
  768. x***************
  769. x*** 122,126
  770. x  
  771. x      if (hflg == 0)
  772. x          printf("%6d\t", hp->Hnum);
  773. x      prlex(&hp->Hlex);
  774. x  }
  775. x
  776. x--- 126,141 -----
  777. x      if (hflg == 0)
  778. x      {
  779. x          printf("%6d\t", hp->Hnum);
  780. x+         t = localtime(&hp->Htime);
  781. x+         if (t->tm_hour >= 12)
  782. x+         {
  783. x+             if (t->tm_hour > 12)
  784. x+                 t->tm_hour -= 12;
  785. x+             ampm = 'p';
  786. x+         }
  787. x+         else if (t->tm_hour == 0)
  788. x+             t->tm_hour = 12;
  789. x+         printf ("%2d:%02d%cm\t", t->tm_hour, t->tm_min, ampm);
  790. x+     }
  791. x      prlex(&hp->Hlex);
  792. x  }
  793. x*** ../csh4.2/sh.init.c    Tue Jun 23 12:13:53 1987
  794. x--- sh.init.c    Tue Jun 30 15:50:52 1987
  795. x***************
  796. x*** 8,13
  797. x  
  798. x  extern    int doalias();
  799. x  extern    int dobg();
  800. x  extern    int dobreak();
  801. x  extern    int dochngd();
  802. x  extern    int docontin();
  803. x
  804. x--- 8,14 -----
  805. x  
  806. x  extern    int doalias();
  807. x  extern    int dobg();
  808. x+ extern    int dobind();
  809. x  extern    int dobreak();
  810. x  extern    int dochngd();
  811. x  extern    int docontin();
  812. x***************
  813. x*** 29,34
  814. x  extern    int dojobs();
  815. x  extern    int dokill();
  816. x  extern    int dolet();
  817. x  extern    int dolimit();
  818. x  extern    int dologin();
  819. x  extern    int dologout();
  820. x
  821. x--- 30,36 -----
  822. x  extern    int dojobs();
  823. x  extern    int dokill();
  824. x  extern    int dolet();
  825. x+ #ifndef OREO
  826. x  extern    int dolimit();
  827. x  #endif
  828. x  extern    int dolog();
  829. x***************
  830. x*** 30,35
  831. x  extern    int dokill();
  832. x  extern    int dolet();
  833. x  extern    int dolimit();
  834. x  extern    int dologin();
  835. x  extern    int dologout();
  836. x  #ifdef NEWGRP
  837. x
  838. x--- 32,39 -----
  839. x  extern    int dolet();
  840. x  #ifndef OREO
  841. x  extern    int dolimit();
  842. x+ #endif
  843. x+ extern    int dolog();
  844. x  extern    int dologin();
  845. x  extern    int dologout();
  846. x  #ifdef NEWGRP
  847. x***************
  848. x*** 42,47
  849. x  extern    int dopopd();
  850. x  extern    int dopushd();
  851. x  extern    int dorepeat();
  852. x  extern    int doset();
  853. x  extern    int dosetenv();
  854. x  extern    int dosource();
  855. x
  856. x--- 46,52 -----
  857. x  extern    int dopopd();
  858. x  extern    int dopushd();
  859. x  extern    int dorepeat();
  860. x+ extern    int dosched();
  861. x  extern    int doset();
  862. x  extern    int dosetenv();
  863. x  extern    int dosource();
  864. x***************
  865. x*** 50,55
  866. x  extern    int doswbrk();
  867. x  extern    int doswitch();
  868. x  extern    int dotime();
  869. x  extern    int dounlimit();
  870. x  extern    int doumask();
  871. x  extern    int dowait();
  872. x
  873. x--- 55,61 -----
  874. x  extern    int doswbrk();
  875. x  extern    int doswitch();
  876. x  extern    int dotime();
  877. x+ #ifndef OREO
  878. x  extern    int dounlimit();
  879. x  #endif
  880. x  extern    int doumask();
  881. x***************
  882. x*** 51,56
  883. x  extern    int doswitch();
  884. x  extern    int dotime();
  885. x  extern    int dounlimit();
  886. x  extern    int doumask();
  887. x  extern    int dowait();
  888. x  extern    int dowhile();
  889. x
  890. x--- 57,63 -----
  891. x  extern    int dotime();
  892. x  #ifndef OREO
  893. x  extern    int dounlimit();
  894. x+ #endif
  895. x  extern    int doumask();
  896. x  extern    int dowait();
  897. x  extern    int dowhile();
  898. x***************
  899. x*** 66,71
  900. x  extern    int dounhash();
  901. x  extern    int unset();
  902. x  extern    int dounsetenv();
  903. x  
  904. x  #define    INF    1000
  905. x  
  906. x
  907. x--- 73,79 -----
  908. x  extern    int dounhash();
  909. x  extern    int unset();
  910. x  extern    int dounsetenv();
  911. x+ extern    int dolist();        /* for ls-F */
  912. x  
  913. x  #define    INF    1000
  914. x  
  915. x***************
  916. x*** 76,82
  917. x  } bfunc[] = {
  918. x      "@",        dolet,        0,    INF,
  919. x      "alias",    doalias,    0,    INF,
  920. x- #ifdef debug
  921. x      "alloc",    showall,    0,    1,
  922. x  #endif
  923. x      "bg",        dobg,        0,    INF,
  924. x
  925. x--- 84,89 -----
  926. x  } bfunc[] = {
  927. x      "@",        dolet,        0,    INF,
  928. x      "alias",    doalias,    0,    INF,
  929. x      "alloc",    showall,    0,    1,
  930. x      "bg",        dobg,        0,    INF,
  931. x      "bind",        dobind,        0,    2,
  932. x***************
  933. x*** 78,84
  934. x      "alias",    doalias,    0,    INF,
  935. x  #ifdef debug
  936. x      "alloc",    showall,    0,    1,
  937. x- #endif
  938. x      "bg",        dobg,        0,    INF,
  939. x      "break",    dobreak,    0,    0,
  940. x      "breaksw",    doswbrk,    0,    0,
  941. x
  942. x--- 85,90 -----
  943. x      "@",        dolet,        0,    INF,
  944. x      "alias",    doalias,    0,    INF,
  945. x      "alloc",    showall,    0,    1,
  946. x      "bg",        dobg,        0,    INF,
  947. x      "bind",        dobind,        0,    2,
  948. x      "break",    dobreak,    0,    0,
  949. x***************
  950. x*** 80,85
  951. x      "alloc",    showall,    0,    1,
  952. x  #endif
  953. x      "bg",        dobg,        0,    INF,
  954. x      "break",    dobreak,    0,    0,
  955. x      "breaksw",    doswbrk,    0,    0,
  956. x  #ifdef IIASA
  957. x
  958. x--- 86,92 -----
  959. x      "alias",    doalias,    0,    INF,
  960. x      "alloc",    showall,    0,    1,
  961. x      "bg",        dobg,        0,    INF,
  962. x+     "bind",        dobind,        0,    2,
  963. x      "break",    dobreak,    0,    0,
  964. x      "breaksw",    doswbrk,    0,    0,
  965. x  #ifdef IIASA
  966. x***************
  967. x*** 113,118
  968. x      "if",        doif,        1,    INF,
  969. x      "jobs",        dojobs,        0,    1,
  970. x      "kill",        dokill,        1,    INF,
  971. x      "limit",    dolimit,    0,    3,
  972. x      "login",    dologin,    0,    1,
  973. x      "logout",    dologout,    0,    0,
  974. x
  975. x--- 120,126 -----
  976. x      "if",        doif,        1,    INF,
  977. x      "jobs",        dojobs,        0,    1,
  978. x      "kill",        dokill,        1,    INF,
  979. x+ #ifndef OREO
  980. x      "limit",    dolimit,    0,    3,
  981. x  #endif OREO
  982. x      "linedit",    doecho,        0,    INF,
  983. x***************
  984. x*** 114,119
  985. x      "jobs",        dojobs,        0,    1,
  986. x      "kill",        dokill,        1,    INF,
  987. x      "limit",    dolimit,    0,    3,
  988. x      "login",    dologin,    0,    1,
  989. x      "logout",    dologout,    0,    0,
  990. x  #ifdef NEWGRP
  991. x
  992. x--- 122,130 -----
  993. x      "kill",        dokill,        1,    INF,
  994. x  #ifndef OREO
  995. x      "limit",    dolimit,    0,    3,
  996. x+ #endif OREO
  997. x+     "linedit",    doecho,        0,    INF,
  998. x+     "log",        dolog,        0,    0,
  999. x      "login",    dologin,    0,    1,
  1000. x      "logout",    dologout,    0,    0,
  1001. x      "ls-F",        dolist,        0,    INF,
  1002. x***************
  1003. x*** 116,121
  1004. x      "limit",    dolimit,    0,    3,
  1005. x      "login",    dologin,    0,    1,
  1006. x      "logout",    dologout,    0,    0,
  1007. x  #ifdef NEWGRP
  1008. x      "newgrp",    donewgrp,    1,    1,
  1009. x  #endif
  1010. x
  1011. x--- 127,133 -----
  1012. x      "log",        dolog,        0,    0,
  1013. x      "login",    dologin,    0,    1,
  1014. x      "logout",    dologout,    0,    0,
  1015. x+     "ls-F",        dolist,        0,    INF,
  1016. x  #ifdef NEWGRP
  1017. x      "newgrp",    donewgrp,    1,    1,
  1018. x  #endif
  1019. x***************
  1020. x*** 130,135
  1021. x  #endif
  1022. x      "rehash",    dohash,        0,    0,
  1023. x      "repeat",    dorepeat,    2,    INF,
  1024. x      "set",        doset,        0,    INF,
  1025. x      "setenv",    dosetenv,    2,    2,
  1026. x      "shift",    shift,        0,    1,
  1027. x
  1028. x--- 142,148 -----
  1029. x  #endif
  1030. x      "rehash",    dohash,        0,    0,
  1031. x      "repeat",    dorepeat,    2,    INF,
  1032. x+     "sched",    dosched,    0,    INF,
  1033. x      "set",        doset,        0,    INF,
  1034. x      "setenv",    dosetenv,    2,    2,
  1035. x      "shift",    shift,        0,    1,
  1036. x***************
  1037. x*** 141,146
  1038. x      "umask",    doumask,    0,    1,
  1039. x      "unalias",    unalias,    1,    INF,
  1040. x      "unhash",    dounhash,    0,    0,
  1041. x      "unlimit",    dounlimit,    0,    INF,
  1042. x      "unset",    unset,        1,    INF,
  1043. x      "unsetenv",    dounsetenv,    1,    INF,
  1044. x
  1045. x--- 154,160 -----
  1046. x      "umask",    doumask,    0,    1,
  1047. x      "unalias",    unalias,    1,    INF,
  1048. x      "unhash",    dounhash,    0,    0,
  1049. x+ #ifndef OREO
  1050. x      "unlimit",    dounlimit,    0,    INF,
  1051. x  #endif
  1052. x      "unset",    unset,        1,    INF,
  1053. x***************
  1054. x*** 142,147
  1055. x      "unalias",    unalias,    1,    INF,
  1056. x      "unhash",    dounhash,    0,    0,
  1057. x      "unlimit",    dounlimit,    0,    INF,
  1058. x      "unset",    unset,        1,    INF,
  1059. x      "unsetenv",    dounsetenv,    1,    INF,
  1060. x      "wait",        dowait,        0,    0,
  1061. x
  1062. x--- 156,162 -----
  1063. x      "unhash",    dounhash,    0,    0,
  1064. x  #ifndef OREO
  1065. x      "unlimit",    dounlimit,    0,    INF,
  1066. x+ #endif
  1067. x      "unset",    unset,        1,    INF,
  1068. x      "unsetenv",    dounsetenv,    1,    INF,
  1069. x      "wait",        dowait,        0,    0,
  1070. x***************
  1071. x*** 213,219
  1072. x      "PIPE",    "Broken pipe",
  1073. x      "ALRM",    "Alarm clock",
  1074. x      "TERM",    "Terminated",
  1075. x!     0,    "Signal 16",
  1076. x      "STOP",    "Stopped (signal)",
  1077. x      "TSTP",    "Stopped",
  1078. x      "CONT",    "Continued",
  1079. x
  1080. x--- 228,236 -----
  1081. x      "PIPE",    "Broken pipe",
  1082. x      "ALRM",    "Alarm clock",
  1083. x      "TERM",    "Terminated",
  1084. x! #ifdef SVID
  1085. x! # ifdef pyr            /* these are really the BSD sigs, plus a few */
  1086. x!     "URG",    "Urgent condition on IO channel",
  1087. x      "STOP",    "Stopped (signal)",
  1088. x      "TSTP",    "Stopped",
  1089. x      "CONT",    "Continued",
  1090. x***************
  1091. x*** 220,226
  1092. x      "CHLD",    "Child exited",
  1093. x      "TTIN", "Stopped (tty input)",
  1094. x      "TTOU", "Stopped (tty output)",
  1095. x!     "TINT", "Tty input interrupt",
  1096. x      "XCPU",    "Cputime limit exceeded",
  1097. x      "XFSZ", "Filesize limit exceeded",
  1098. x      0,    "Signal 26",
  1099. x
  1100. x--- 237,243 -----
  1101. x      "CHLD",    "Child exited",
  1102. x      "TTIN", "Stopped (tty input)",
  1103. x      "TTOU", "Stopped (tty output)",
  1104. x!     "IO",   "IO possible interrupt",
  1105. x      "XCPU",    "Cputime limit exceeded",
  1106. x      "XFSZ", "Filesize limit exceeded",
  1107. x      "VTALRM", "Virtual time alarm",
  1108. x***************
  1109. x*** 223,228
  1110. x      "TINT", "Tty input interrupt",
  1111. x      "XCPU",    "Cputime limit exceeded",
  1112. x      "XFSZ", "Filesize limit exceeded",
  1113. x      0,    "Signal 26",
  1114. x      0,    "Signal 27",
  1115. x      0,    "Signal 28",
  1116. x
  1117. x--- 240,275 -----
  1118. x      "IO",   "IO possible interrupt",
  1119. x      "XCPU",    "Cputime limit exceeded",
  1120. x      "XFSZ", "Filesize limit exceeded",
  1121. x+     "VTALRM", "Virtual time alarm",
  1122. x+     "PROF",    "Profiling time alarm",
  1123. x+     "USR1",    "User signal 1",
  1124. x+     "USR2",    "User signal 2",
  1125. x+     "PWR",    "Power failure",
  1126. x+     0,    "Signal 31",
  1127. x+     0,    "Signal 32"
  1128. x+ # else pyr            /* the first four real SVID sigs. */
  1129. x+     "USR1",    "User signal 1",
  1130. x+     "USR2", "User signal 2",
  1131. x+     "CHLD",    "Child exited",
  1132. x+     "PWR",  "Power failure",
  1133. x+ #  ifdef OREO
  1134. x+     "TSTP",    "Stopped",
  1135. x+     "TTIN", "Stopped (tty input)",
  1136. x+     "TTOU", "Stopped (tty output)",
  1137. x+     "STOP",    "Stopped (signal)",
  1138. x+     "XCPU",    "Cputime limit exceeded",
  1139. x+     "XFSZ", "Filesize limit exceeded",
  1140. x+     "VTALRM", "Virtual time alarm",
  1141. x+     "PROF", "Profiling time alarm",
  1142. x+     "WINCH", "Window changed",
  1143. x+     "CONT",    "Continued",
  1144. x+ #  else OREO
  1145. x+     0,    "Signal 20",
  1146. x+     0,    "Signal 21",
  1147. x+     0,    "Signal 22",
  1148. x+     0,    "Signal 23",
  1149. x+     0,    "Signal 24",
  1150. x+     0,    "Signal 25",
  1151. x      0,    "Signal 26",
  1152. x      0,    "Signal 27",
  1153. x      0,    "Signal 28",
  1154. x***************
  1155. x*** 227,232
  1156. x      0,    "Signal 27",
  1157. x      0,    "Signal 28",
  1158. x      0,    "Signal 29",
  1159. x      0,    "Signal 30",
  1160. x      0,    "Signal 31",
  1161. x      0,    "Signal 32"
  1162. x
  1163. x--- 274,280 -----
  1164. x      0,    "Signal 27",
  1165. x      0,    "Signal 28",
  1166. x      0,    "Signal 29",
  1167. x+ #  endif OREO
  1168. x      0,    "Signal 30",
  1169. x      0,    "Signal 31",
  1170. x      0,    "Signal 32"
  1171. x***************
  1172. x*** 230,233
  1173. x      0,    "Signal 30",
  1174. x      0,    "Signal 31",
  1175. x      0,    "Signal 32"
  1176. x  };
  1177. x
  1178. x--- 278,317 -----
  1179. x      0,    "Signal 30",
  1180. x      0,    "Signal 31",
  1181. x      0,    "Signal 32"
  1182. x+ # endif pyr
  1183. x+ #else SVID
  1184. x+     "URG",    "Urgent condition on IO channel",
  1185. x+     "STOP",    "Stopped (signal)",
  1186. x+     "TSTP",    "Stopped",
  1187. x+     "CONT",    "Continued",
  1188. x+     "CHLD",    "Child exited",
  1189. x+     "TTIN", "Stopped (tty input)",
  1190. x+     "TTOU", "Stopped (tty output)",
  1191. x+     "IO",   "IO possible interrupt",
  1192. x+     "XCPU",    "Cputime limit exceeded",
  1193. x+     "XFSZ", "Filesize limit exceeded",
  1194. x+     "VTALRM", "Virtual time alarm",
  1195. x+     "PROF",    "Profiling time alarm",
  1196. x+ # ifdef sun
  1197. x+     "WINCH", "Window changed",
  1198. x+     "LOST",    "Resource lost",
  1199. x+     "USR1",    "User signal 1",
  1200. x+     "USR2",    "User signal 2",
  1201. x+     0,    "Signal 32"
  1202. x+ # else sun
  1203. x+ #  ifdef pyr
  1204. x+     "USR1",    "User signal 1",
  1205. x+     "USR2",    "User signal 2",
  1206. x+     "PWR",    "Power failure",
  1207. x+     0,    "Signal 31",
  1208. x+     0,    "Signal 32"
  1209. x+ #  else pyr
  1210. x+     0,    "Signal 28",
  1211. x+     0,    "Signal 29",
  1212. x+     0,    "Signal 30",
  1213. x+     0,    "Signal 31",
  1214. x+     0,    "Signal 32"
  1215. x+ #  endif pyr
  1216. x+ # endif sun
  1217. x+ #endif SVID
  1218. x  };
  1219. x*** ../csh4.2/sh.lex.c    Tue Jun 23 12:13:57 1987
  1220. x--- sh.lex.c    Mon Jun 29 17:41:22 1987
  1221. x***************
  1222. x*** 179,184
  1223. x                  else {
  1224. x                      if (c == '\n' && c1 != '`')
  1225. x                          c |= QUOTE;
  1226. x                      ungetC(c), c = '\\';
  1227. x                  }
  1228. x              }
  1229. x
  1230. x--- 179,189 -----
  1231. x                  else {
  1232. x                      if (c == '\n' && c1 != '`')
  1233. x                          c |= QUOTE;
  1234. x+                     else if (c == '"')
  1235. x+                         c |= QUOTE;
  1236. x+                     else if (c == '\'')
  1237. x+                         c |= QUOTE;
  1238. x+                     else
  1239. x                          ungetC(c), c = '\\';
  1240. x                  }
  1241. x              }
  1242. x***************
  1243. x*** 1126,1132
  1244. x  reread:
  1245. x          c = bgetc();
  1246. x          if (c < 0) {
  1247. x! #include <sgtty.h>
  1248. x              struct sgttyb tty;
  1249. x  
  1250. x              if (wanteof)
  1251. x
  1252. x--- 1131,1142 -----
  1253. x  reread:
  1254. x          c = bgetc();
  1255. x          if (c < 0) {
  1256. x! #ifdef SVID
  1257. x! #include <termio.h>
  1258. x! #include <sys/ioctl.h>
  1259. x!             struct termio tty;
  1260. x! #else SVID
  1261. x! /* #include <sgtty.h> */
  1262. x              struct sgttyb tty;
  1263. x  #endif SVID
  1264. x  
  1265. x***************
  1266. x*** 1128,1133
  1267. x          if (c < 0) {
  1268. x  #include <sgtty.h>
  1269. x              struct sgttyb tty;
  1270. x  
  1271. x              if (wanteof)
  1272. x                  return (-1);
  1273. x
  1274. x--- 1138,1144 -----
  1275. x  #else SVID
  1276. x  /* #include <sgtty.h> */
  1277. x              struct sgttyb tty;
  1278. x+ #endif SVID
  1279. x  
  1280. x              if (wanteof)
  1281. x                  return (-1);
  1282. x***************
  1283. x*** 1132,1138
  1284. x              if (wanteof)
  1285. x                  return (-1);
  1286. x              /* was isatty but raw with ignoreeof yields problems */
  1287. x!             if (ioctl(SHIN, TIOCGETP, &tty)==0 && (tty.sg_flags & RAW) == 0) {
  1288. x                  int ctpgrp;
  1289. x  
  1290. x                  if (++sincereal > 25)
  1291. x
  1292. x--- 1143,1155 -----
  1293. x              if (wanteof)
  1294. x                  return (-1);
  1295. x              /* was isatty but raw with ignoreeof yields problems */
  1296. x! #ifdef SVID
  1297. x!             if (ioctl(SHIN, TCGETA, &tty)==0 &&
  1298. x!                 (tty.c_cc[VEOF] != CEOF)) {
  1299. x! #else SVID
  1300. x!             if (ioctl(SHIN, TIOCGETP, &tty)==0 &&
  1301. x!                 (tty.sg_flags & RAW) == 0) {
  1302. x! #endif SVID
  1303. x                  int ctpgrp;
  1304. x  
  1305. x                  if (++sincereal > 25)
  1306. x***************
  1307. x*** 1137,1142
  1308. x  
  1309. x                  if (++sincereal > 25)
  1310. x                      goto oops;
  1311. x                  if (tpgrp != -1 &&
  1312. x                      ioctl(FSHTTY, TIOCGPGRP, &ctpgrp) == 0 &&
  1313. x                      tpgrp != ctpgrp) {
  1314. x
  1315. x--- 1154,1160 -----
  1316. x  
  1317. x                  if (++sincereal > 25)
  1318. x                      goto oops;
  1319. x+ #ifdef BSDJOBS
  1320. x                  if (tpgrp != -1 &&
  1321. x                      ioctl(FSHTTY, TIOCGPGRP, &ctpgrp) == 0 &&
  1322. x                      tpgrp != ctpgrp) {
  1323. x***************
  1324. x*** 1145,1150
  1325. x  printf("Reset tty pgrp from %d to %d\n", ctpgrp, tpgrp);
  1326. x                      goto reread;
  1327. x                  }
  1328. x                  if (adrof("ignoreeof")) {
  1329. x                      if (loginsh)
  1330. x                          printf("\nUse \"logout\" to logout.\n");
  1331. x
  1332. x--- 1163,1169 -----
  1333. x  printf("Reset tty pgrp from %d to %d\n", ctpgrp, tpgrp);
  1334. x                      goto reread;
  1335. x                  }
  1336. x+ #endif BSDJOBS
  1337. x                  if (adrof("ignoreeof")) {
  1338. x                      if (loginsh)
  1339. x                          printf("\nUse \"logout\" to logout.\n");
  1340. x***************
  1341. x*** 1149,1155
  1342. x                      if (loginsh)
  1343. x                          printf("\nUse \"logout\" to logout.\n");
  1344. x                      else
  1345. x!                         printf("\nUse \"exit\" to leave csh.\n");
  1346. x                      reset();
  1347. x                  }
  1348. x                  if (chkstop == 0)
  1349. x
  1350. x--- 1168,1174 -----
  1351. x                      if (loginsh)
  1352. x                          printf("\nUse \"logout\" to logout.\n");
  1353. x                      else
  1354. x!                         printf("\nUse \"exit\" to leave tcsh.\n");
  1355. x                      reset();
  1356. x                  }
  1357. x                  if (chkstop == 0)
  1358. x***************
  1359. x*** 1169,1174
  1360. x  bgetc()
  1361. x  {
  1362. x      register int buf, off, c;
  1363. x  
  1364. x  #ifdef TELL
  1365. x      if (cantell) {
  1366. x
  1367. x--- 1188,1195 -----
  1368. x  bgetc()
  1369. x  {
  1370. x      register int buf, off, c;
  1371. x+     extern char InputBuf[];
  1372. x+     register int numleft = 0, roomleft;
  1373. x  
  1374. x  #ifdef TELL
  1375. x      if (cantell) {
  1376. x***************
  1377. x*** 1202,1207
  1378. x          fbuf = nfbuf;
  1379. x          fbuf[fblocks] = calloc(BUFSIZ, sizeof (char));
  1380. x          fblocks++;
  1381. x          goto again;
  1382. x      }
  1383. x      if (fseekp >= feobp) {
  1384. x
  1385. x--- 1223,1229 -----
  1386. x          fbuf = nfbuf;
  1387. x          fbuf[fblocks] = calloc(BUFSIZ, sizeof (char));
  1388. x          fblocks++;
  1389. x+         if (!intty)
  1390. x              goto again;
  1391. x      }
  1392. x      if (fseekp >= feobp) {
  1393. x***************
  1394. x*** 1207,1212
  1395. x      if (fseekp >= feobp) {
  1396. x          buf = (int) feobp / BUFSIZ;
  1397. x          off = (int) feobp % BUFSIZ;
  1398. x          do
  1399. x              c = read(SHIN, fbuf[buf] + off, BUFSIZ - off);
  1400. x          while (c < 0 && errno == EINTR);
  1401. x
  1402. x--- 1229,1235 -----
  1403. x      if (fseekp >= feobp) {
  1404. x          buf = (int) feobp / BUFSIZ;
  1405. x          off = (int) feobp % BUFSIZ;
  1406. x+         roomleft = BUFSIZ - off;
  1407. x          do
  1408. x              if (intty)            /* then use twenex routine */
  1409. x              {
  1410. x***************
  1411. x*** 1208,1214
  1412. x          buf = (int) feobp / BUFSIZ;
  1413. x          off = (int) feobp % BUFSIZ;
  1414. x          do
  1415. x!             c = read(SHIN, fbuf[buf] + off, BUFSIZ - off);
  1416. x          while (c < 0 && errno == EINTR);
  1417. x          if (c <= 0)
  1418. x              return (-1);
  1419. x
  1420. x--- 1231,1253 -----
  1421. x          off = (int) feobp % BUFSIZ;
  1422. x          roomleft = BUFSIZ - off;
  1423. x          do
  1424. x!             if (intty)            /* then use twenex routine */
  1425. x!             {
  1426. x!             c = numleft ? numleft : Inputl(); /* PWP: get a line */
  1427. x!             if (c > roomleft)    /* No room in this buffer? */
  1428. x!             {
  1429. x!                 /* start with fresh buffer */
  1430. x!                 feobp = fseekp = fblocks * BUFSIZ;
  1431. x!                 numleft = c;
  1432. x!                 goto again;
  1433. x!             }
  1434. x!             if (c > 0)
  1435. x!                 copy (fbuf[buf] + off, InputBuf, c);
  1436. x!                 /* copy (fbuf[buf] + off, ttyline, c); */
  1437. x!             numleft = 0;
  1438. x!             }
  1439. x!             else
  1440. x!             c = read(SHIN, fbuf[buf] + off, roomleft);
  1441. x          while (c < 0 && errno == EINTR);
  1442. x          if (c <= 0)
  1443. x              return (-1);
  1444. x***************
  1445. x*** 1213,1218
  1446. x          if (c <= 0)
  1447. x              return (-1);
  1448. x          feobp += c;
  1449. x          goto again;
  1450. x      }
  1451. x      c = fbuf[buf][(int) fseekp % BUFSIZ];
  1452. x
  1453. x--- 1252,1258 -----
  1454. x          if (c <= 0)
  1455. x              return (-1);
  1456. x          feobp += c;
  1457. x+         if (!intty)
  1458. x              goto again;
  1459. x      }
  1460. x      c = fbuf[buf][(int) fseekp % BUFSIZ];
  1461. x*** ../csh4.2/sh.local.h    Tue Jun 23 12:13:57 1987
  1462. x--- sh.local.h    Tue Jun 30 16:10:30 1987
  1463. x***************
  1464. x*** 18,25
  1465. x   */
  1466. x  
  1467. x  #define    BUFSIZ    1024        /* default buffer size */
  1468. x! #define HZ    100        /* for division into seconds */
  1469. x! #define    SHELLPATH    "/bin/csh"
  1470. x  #define    OTHERSH        "/bin/sh"
  1471. x  #define FORKSLEEP    10    /* delay loop on non-interactive fork failure */
  1472. x  #define    MAILINTVL    600    /* 10 minutes */
  1473. x
  1474. x--- 18,27 -----
  1475. x   */
  1476. x  
  1477. x  #define    BUFSIZ    1024        /* default buffer size */
  1478. x! /* #define HZ    100        /* for division into seconds */
  1479. x! #ifndef SHELLPATH
  1480. x! #define    SHELLPATH    "/bin/tcsh"
  1481. x! #endif
  1482. x  #define    OTHERSH        "/bin/sh"
  1483. x  #define FORKSLEEP    10    /* delay loop on non-interactive fork failure */
  1484. x  #define    MAILINTVL    600    /* 10 minutes */
  1485. x***************
  1486. x*** 27,32
  1487. x  /*
  1488. x   * NCARGS and NOFILE are from <sys/param.h> which we choose not
  1489. x   * to wholly include
  1490. x   */
  1491. x  #define    NCARGS    10240        /* Max. chars in an argument list */
  1492. x  
  1493. x
  1494. x--- 29,35 -----
  1495. x  /*
  1496. x   * NCARGS and NOFILE are from <sys/param.h> which we choose not
  1497. x   * to wholly include
  1498. x+  * -- except that we DO include param.h... -- PWP
  1499. x   */
  1500. x  /* #define    NCARGS    10240        /* Max. chars in an argument list */
  1501. x  
  1502. x***************
  1503. x*** 28,34
  1504. x   * NCARGS and NOFILE are from <sys/param.h> which we choose not
  1505. x   * to wholly include
  1506. x   */
  1507. x! #define    NCARGS    10240        /* Max. chars in an argument list */
  1508. x  
  1509. x  /*
  1510. x   * The shell moves std in/out/diag and the old std input away from units
  1511. x
  1512. x--- 31,37 -----
  1513. x   * to wholly include
  1514. x   * -- except that we DO include param.h... -- PWP
  1515. x   */
  1516. x! /* #define    NCARGS    10240        /* Max. chars in an argument list */
  1517. x  
  1518. x  /*
  1519. x   * The shell moves std in/out/diag and the old std input away from units
  1520. x***************
  1521. x*** 35,41
  1522. x   * 0, 1, and 2 so that it is easy to set up these standards for invoked
  1523. x   * commands.  If possible they should go into descriptors closed by exec.
  1524. x   */
  1525. x! #define    NOFILE    20        /* Max number of open files */
  1526. x  #define    FSHTTY    15        /* /dev/tty when manip pgrps */
  1527. x  #define    FSHIN    16        /* Preferred desc for shell input */
  1528. x  #define    FSHOUT    17        /* ... shell output */
  1529. x
  1530. x--- 38,44 -----
  1531. x   * 0, 1, and 2 so that it is easy to set up these standards for invoked
  1532. x   * commands.  If possible they should go into descriptors closed by exec.
  1533. x   */
  1534. x! /* #define    NOFILE    20        /* Max number of open files */
  1535. x  #define    FSHTTY    15        /* /dev/tty when manip pgrps */
  1536. x  #define    FSHIN    16        /* Preferred desc for shell input */
  1537. x  #define    FSHOUT    17        /* ... shell output */
  1538. x*** ../csh4.2/sh.misc.c    Tue Jun 23 12:13:59 1987
  1539. x--- sh.misc.c    Sun Jun 28 23:20:28 1987
  1540. x***************
  1541. x*** 57,63
  1542. x          showall(av);
  1543. x          printf("i=%d, j=%d: ", i/j, j);
  1544. x          printf("Out of memory\n");
  1545. x!         chdir("/usr/bill/cshcore");
  1546. x          abort();
  1547. x  #endif
  1548. x      }
  1549. x
  1550. x--- 57,63 -----
  1551. x          showall(av);
  1552. x          printf("i=%d, j=%d: ", i/j, j);
  1553. x          printf("Out of memory\n");
  1554. x!         /* chdir("/usr/bill/cshcore"); */
  1555. x          abort();
  1556. x  #endif
  1557. x      }
  1558. xNo differences encountered
  1559. x*** ../csh4.2/sh.print.c    Tue Jun 23 12:14:01 1987
  1560. x--- sh.print.c    Sat Jul  4 12:33:06 1987
  1561. x***************
  1562. x*** 33,39
  1563. x      printf("%d%d", i / 10, i % 10);
  1564. x  }
  1565. x  
  1566. x! char    linbuf[128];
  1567. x  char    *linp = linbuf;
  1568. x  
  1569. x  putchar(c)
  1570. x
  1571. x--- 33,39 -----
  1572. x      printf("%d%d", i / 10, i % 10);
  1573. x  }
  1574. x  
  1575. x! char    linbuf[2048];        /* was 128 */
  1576. x  char    *linp = linbuf;
  1577. x  int lbuffed = 1;        /* true if line buffered */
  1578. x  
  1579. x***************
  1580. x*** 35,40
  1581. x  
  1582. x  char    linbuf[128];
  1583. x  char    *linp = linbuf;
  1584. x  
  1585. x  putchar(c)
  1586. x      register int c;
  1587. x
  1588. x--- 35,41 -----
  1589. x  
  1590. x  char    linbuf[2048];        /* was 128 */
  1591. x  char    *linp = linbuf;
  1592. x+ int lbuffed = 1;        /* true if line buffered */
  1593. x  
  1594. x  putchar(c)
  1595. x      register int c;
  1596. x***************
  1597. x*** 40,46
  1598. x      register int c;
  1599. x  {
  1600. x  
  1601. x!     if ((c & QUOTE) == 0 && (c == 0177 || c < ' ' && c != '\t' && c != '\n')) {
  1602. x          putchar('^');
  1603. x          if (c == 0177)
  1604. x              c = '?';
  1605. x
  1606. x--- 41,47 -----
  1607. x      register int c;
  1608. x  {
  1609. x  
  1610. x!     if ((c & QUOTE) == 0 && (c == 0177 || c < ' ' && c != '\t' && c != '\n' && c != '\r')) {
  1611. x          putchar('^');
  1612. x          if (c == 0177)
  1613. x              c = '?';
  1614. x***************
  1615. x*** 49,55
  1616. x      }
  1617. x      c &= TRIM;
  1618. x      *linp++ = c;
  1619. x!     if (c == '\n' || linp >= &linbuf[sizeof linbuf - 2])
  1620. x          flush();
  1621. x  }
  1622. x  
  1623. x
  1624. x--- 50,56 -----
  1625. x      }
  1626. x      c &= TRIM;
  1627. x      *linp++ = c;
  1628. x!     if ((lbuffed && c == '\n') || linp >= &linbuf[sizeof linbuf - 2])
  1629. x          flush();
  1630. x  }
  1631. x  
  1632. x***************
  1633. x*** 53,58
  1634. x          flush();
  1635. x  }
  1636. x  
  1637. x  draino()
  1638. x  {
  1639. x  
  1640. x
  1641. x--- 54,68 -----
  1642. x          flush();
  1643. x  }
  1644. x  
  1645. x+ putraw(c)
  1646. x+     register int c;
  1647. x+ {
  1648. x+     c &= TRIM;
  1649. x+     *linp++ = c;
  1650. x+     if (linp >= &linbuf[sizeof linbuf - 2])
  1651. x+         flush();
  1652. x+ }
  1653. x+ 
  1654. x  draino()
  1655. x  {
  1656. x  
  1657. x***************
  1658. x*** 80,86
  1659. x          write(unit, "\n", 1);
  1660. x      }
  1661. x  #endif
  1662. x!     write(unit, linbuf, linp - linbuf);
  1663. x      linp = linbuf;
  1664. x  }
  1665. x  
  1666. x
  1667. x--- 90,96 -----
  1668. x          write(unit, "\n", 1);
  1669. x      }
  1670. x  #endif
  1671. x!     write(unit, linbuf, (int) (linp - linbuf));
  1672. x      linp = linbuf;
  1673. x  }
  1674. x  
  1675. x*** ../csh4.2/sh.proc.c    Tue Jun 23 12:14:03 1987
  1676. x--- sh.proc.c    Mon Jun 29 17:52:26 1987
  1677. x***************
  1678. x*** 6,11
  1679. x  #include <sys/wait.h>
  1680. x  #include <sys/ioctl.h>
  1681. x  
  1682. x  /*
  1683. x   * C Shell - functions that manage processes, handling hanging, termination
  1684. x   */
  1685. x
  1686. x--- 6,15 -----
  1687. x  #include <sys/wait.h>
  1688. x  #include <sys/ioctl.h>
  1689. x  
  1690. x+ #ifndef HZ
  1691. x+ #define HZ    100        /* for division into seconds */
  1692. x+ #endif
  1693. x+ 
  1694. x  /*
  1695. x   * C Shell - functions that manage processes, handling hanging, termination
  1696. x   */
  1697. x***************
  1698. x*** 26,31
  1699. x      register int pid;
  1700. x      union wait w;
  1701. x      int jobflags;
  1702. x      struct rusage ru;
  1703. x  
  1704. x      if (!timesdone)
  1705. x
  1706. x--- 30,36 -----
  1707. x      register int pid;
  1708. x      union wait w;
  1709. x      int jobflags;
  1710. x+ #ifndef OREO
  1711. x      struct rusage ru;
  1712. x  #endif
  1713. x  
  1714. x***************
  1715. x*** 27,32
  1716. x      union wait w;
  1717. x      int jobflags;
  1718. x      struct rusage ru;
  1719. x  
  1720. x      if (!timesdone)
  1721. x          timesdone++, times(&shtimes);
  1722. x
  1723. x--- 32,38 -----
  1724. x      int jobflags;
  1725. x  #ifndef OREO
  1726. x      struct rusage ru;
  1727. x+ #endif
  1728. x  
  1729. x      if (!timesdone)
  1730. x          timesdone++, times(&shtimes);
  1731. x***************
  1732. x*** 32,37
  1733. x          timesdone++, times(&shtimes);
  1734. x  loop:
  1735. x      pid = wait3(&w.w_status, (setintr ? WNOHANG|WUNTRACED:WNOHANG),
  1736. x          &ru);
  1737. x      if (pid <= 0) {
  1738. x          if (errno == EINTR) {
  1739. x
  1740. x--- 38,46 -----
  1741. x          timesdone++, times(&shtimes);
  1742. x  loop:
  1743. x      pid = wait3(&w.w_status, (setintr ? WNOHANG|WUNTRACED:WNOHANG),
  1744. x+ #ifdef OREO
  1745. x+         0);
  1746. x+ #else OREO
  1747. x          &ru);
  1748. x  #endif OREO
  1749. x      if (pid <= 0) {
  1750. x***************
  1751. x*** 33,38
  1752. x  loop:
  1753. x      pid = wait3(&w.w_status, (setintr ? WNOHANG|WUNTRACED:WNOHANG),
  1754. x          &ru);
  1755. x      if (pid <= 0) {
  1756. x          if (errno == EINTR) {
  1757. x              errno = 0;
  1758. x
  1759. x--- 42,48 -----
  1760. x          0);
  1761. x  #else OREO
  1762. x          &ru);
  1763. x+ #endif OREO
  1764. x      if (pid <= 0) {
  1765. x          if (errno == EINTR) {
  1766. x              errno = 0;
  1767. x***************
  1768. x*** 63,68
  1769. x              pp->p_stime = shtimes.tms_cstime - oldcstimes;
  1770. x          } else
  1771. x              times(&shtimes);
  1772. x          pp->p_rusage = ru;
  1773. x          if (WIFSIGNALED(w)) {
  1774. x              if (w.w_termsig == SIGINT)
  1775. x
  1776. x--- 73,79 -----
  1777. x              pp->p_stime = shtimes.tms_cstime - oldcstimes;
  1778. x          } else
  1779. x              times(&shtimes);
  1780. x+ #ifndef OREO
  1781. x          pp->p_rusage = ru;
  1782. x  #endif OREO
  1783. x          if (WIFSIGNALED(w)) {
  1784. x***************
  1785. x*** 64,69
  1786. x          } else
  1787. x              times(&shtimes);
  1788. x          pp->p_rusage = ru;
  1789. x          if (WIFSIGNALED(w)) {
  1790. x              if (w.w_termsig == SIGINT)
  1791. x                  pp->p_flags |= PINTERRUPTED;
  1792. x
  1793. x--- 75,81 -----
  1794. x              times(&shtimes);
  1795. x  #ifndef OREO
  1796. x          pp->p_rusage = ru;
  1797. x+ #endif OREO
  1798. x          if (WIFSIGNALED(w)) {
  1799. x              if (w.w_termsig == SIGINT)
  1800. x                  pp->p_flags |= PINTERRUPTED;
  1801. x***************
  1802. x*** 215,220
  1803. x          sigpause(sigblock(0) &~ mask(SIGCHLD));
  1804. x      }
  1805. x      sigrelse(SIGCHLD);
  1806. x      if (tpgrp > 0)
  1807. x          ioctl(FSHTTY, TIOCSPGRP, &tpgrp);    /* get tty back */
  1808. x      if ((jobflags&(PSIGNALED|PSTOPPED|PTIME)) ||
  1809. x
  1810. x--- 227,233 -----
  1811. x          sigpause(sigblock(0) &~ mask(SIGCHLD));
  1812. x      }
  1813. x      sigrelse(SIGCHLD);
  1814. x+ #ifdef BSDJOBS
  1815. x      if (tpgrp > 0)
  1816. x          ioctl(FSHTTY, TIOCSPGRP, &tpgrp);    /* get tty back */
  1817. x  #endif BSDJOBS
  1818. x***************
  1819. x*** 217,222
  1820. x      sigrelse(SIGCHLD);
  1821. x      if (tpgrp > 0)
  1822. x          ioctl(FSHTTY, TIOCSPGRP, &tpgrp);    /* get tty back */
  1823. x      if ((jobflags&(PSIGNALED|PSTOPPED|PTIME)) ||
  1824. x           !eq(dcwd->di_name, fp->p_cwd->di_name)) {
  1825. x          if (jobflags&PSTOPPED)
  1826. x
  1827. x--- 230,236 -----
  1828. x  #ifdef BSDJOBS
  1829. x      if (tpgrp > 0)
  1830. x          ioctl(FSHTTY, TIOCSPGRP, &tpgrp);    /* get tty back */
  1831. x+ #endif BSDJOBS
  1832. x      if ((jobflags&(PSIGNALED|PSTOPPED|PTIME)) ||
  1833. x           !eq(dcwd->di_name, fp->p_cwd->di_name)) {
  1834. x          if (jobflags&PSTOPPED)
  1835. x***************
  1836. x*** 622,627
  1837. x          if (pp->p_flags&PPTIME && !(status&(PSTOPPED|PRUNNING))) {
  1838. x              if (linp != linbuf)
  1839. x                  printf("\n\t");
  1840. x              { static struct rusage zru;
  1841. x                prusage(&zru, &pp->p_rusage, &pp->p_etime,
  1842. x                  &pp->p_btime);
  1843. x
  1844. x--- 636,642 -----
  1845. x          if (pp->p_flags&PPTIME && !(status&(PSTOPPED|PRUNNING))) {
  1846. x              if (linp != linbuf)
  1847. x                  printf("\n\t");
  1848. x+ #ifndef OREO
  1849. x              { static struct rusage zru;
  1850. x                prusage(&zru, &pp->p_rusage, &pp->p_etime,
  1851. x                  &pp->p_btime);
  1852. x***************
  1853. x*** 626,631
  1854. x                prusage(&zru, &pp->p_rusage, &pp->p_etime,
  1855. x                  &pp->p_btime);
  1856. x              }
  1857. x          }
  1858. x          if (tp == pp->p_friends) {
  1859. x              if (linp != linbuf)
  1860. x
  1861. x--- 641,647 -----
  1862. x                prusage(&zru, &pp->p_rusage, &pp->p_etime,
  1863. x                  &pp->p_btime);
  1864. x              }
  1865. x+ #endif OREO
  1866. x          }
  1867. x          if (tp == pp->p_friends) {
  1868. x              if (linp != linbuf)
  1869. x***************
  1870. x*** 648,653
  1871. x  ptprint(tp)
  1872. x      register struct process *tp;
  1873. x  {
  1874. x      struct timeval tetime, diff;
  1875. x      static struct timeval ztime;
  1876. x      struct rusage ru;
  1877. x
  1878. x--- 664,672 -----
  1879. x  ptprint(tp)
  1880. x      register struct process *tp;
  1881. x  {
  1882. x+ #ifdef OREO
  1883. x+     printf ("There is no time stuff for OREO yet (sorry).\n");
  1884. x+ #else OREO
  1885. x      struct timeval tetime, diff;
  1886. x      static struct timeval ztime;
  1887. x      struct rusage ru;
  1888. x***************
  1889. x*** 663,668
  1890. x              tetime = diff;
  1891. x      } while ((pp = pp->p_friends) != tp);
  1892. x      prusage(&zru, &ru, &tetime, &ztime);
  1893. x  }
  1894. x  
  1895. x  /*
  1896. x
  1897. x--- 682,688 -----
  1898. x              tetime = diff;
  1899. x      } while ((pp = pp->p_friends) != tp);
  1900. x      prusage(&zru, &ru, &tetime, &ztime);
  1901. x+ #endif OREO
  1902. x  }
  1903. x  
  1904. x  /*
  1905. x***************
  1906. x*** 892,897
  1907. x      if (!foregnd)
  1908. x          pclrcurr(pp);
  1909. x      pprint(pp, foregnd ? NAME|JOBDIR : NUMBER|NAME|AMPERSAND);
  1910. x      if (foregnd)
  1911. x          ioctl(FSHTTY, TIOCSPGRP, &pp->p_jobid);
  1912. x      if (jobflags&PSTOPPED)
  1913. x
  1914. x--- 912,918 -----
  1915. x      if (!foregnd)
  1916. x          pclrcurr(pp);
  1917. x      pprint(pp, foregnd ? NAME|JOBDIR : NUMBER|NAME|AMPERSAND);
  1918. x+ #ifdef BSDJOBS
  1919. x      if (foregnd)
  1920. x          ioctl(FSHTTY, TIOCSPGRP, &pp->p_jobid);
  1921. x      if (jobflags&PSTOPPED)
  1922. x***************
  1923. x*** 896,901
  1924. x          ioctl(FSHTTY, TIOCSPGRP, &pp->p_jobid);
  1925. x      if (jobflags&PSTOPPED)
  1926. x          killpg(pp->p_jobid, SIGCONT);
  1927. x      sigrelse(SIGCHLD);
  1928. x  }
  1929. x  
  1930. x
  1931. x--- 917,923 -----
  1932. x          ioctl(FSHTTY, TIOCSPGRP, &pp->p_jobid);
  1933. x      if (jobflags&PSTOPPED)
  1934. x          killpg(pp->p_jobid, SIGCONT);
  1935. x+ #endif BSDJOBS
  1936. x      sigrelse(SIGCHLD);
  1937. x  }
  1938. x  
  1939. x***************
  1940. x*** 1061,1066
  1941. x              signal(SIGINT, SIG_IGN);
  1942. x              signal(SIGQUIT, SIG_IGN);
  1943. x          }
  1944. x          if (wanttty > 0)
  1945. x              ioctl(FSHTTY, TIOCSPGRP, &pgrp);
  1946. x          if (wanttty >= 0 && tpgrp >= 0)
  1947. x
  1948. x--- 1083,1089 -----
  1949. x              signal(SIGINT, SIG_IGN);
  1950. x              signal(SIGQUIT, SIG_IGN);
  1951. x          }
  1952. x+ #ifdef BSDJOBS
  1953. x          if (wanttty > 0)
  1954. x              ioctl(FSHTTY, TIOCSPGRP, &pgrp);
  1955. x          if (wanttty >= 0 && tpgrp >= 0)
  1956. x***************
  1957. x*** 1067,1072
  1958. x              setpgrp(0, pgrp);
  1959. x          if (tpgrp > 0)
  1960. x              tpgrp = 0;        /* gave tty away */
  1961. x          /*
  1962. x           * Nohup and nice apply only to TCOM's but it would be
  1963. x           * nice (?!?) if you could say "nohup (foo;bar)"
  1964. x
  1965. x--- 1090,1096 -----
  1966. x              setpgrp(0, pgrp);
  1967. x          if (tpgrp > 0)
  1968. x              tpgrp = 0;        /* gave tty away */
  1969. x+ #endif BSDJOBS
  1970. x          /*
  1971. x           * Nohup and nice apply only to TCOM's but it would be
  1972. x           * nice (?!?) if you could say "nohup (foo;bar)"
  1973. x*** ../csh4.2/sh.proc.h    Tue Jun 23 12:14:04 1987
  1974. x--- sh.proc.h    Sun Jun 28 23:20:42 1987
  1975. x***************
  1976. x*** 24,29
  1977. x      /* if a job is stopped/background p_jobid gives its pgrp */
  1978. x      struct    timeval p_btime;    /* begin time */
  1979. x      struct    timeval p_etime;    /* end time */
  1980. x      struct    rusage p_rusage;
  1981. x      long    p_utime;    /* XXX */
  1982. x      long    p_stime;    /* XXX */
  1983. x
  1984. x--- 24,30 -----
  1985. x      /* if a job is stopped/background p_jobid gives its pgrp */
  1986. x      struct    timeval p_btime;    /* begin time */
  1987. x      struct    timeval p_etime;    /* end time */
  1988. x+ #ifndef OREO
  1989. x      struct    rusage p_rusage;
  1990. x  #endif OREO
  1991. x      long    p_utime;    /* XXX */
  1992. x***************
  1993. x*** 25,30
  1994. x      struct    timeval p_btime;    /* begin time */
  1995. x      struct    timeval p_etime;    /* end time */
  1996. x      struct    rusage p_rusage;
  1997. x      long    p_utime;    /* XXX */
  1998. x      long    p_stime;    /* XXX */
  1999. x      char    *p_command;        /* first PMAXLEN chars of command */
  2000. x
  2001. x--- 26,32 -----
  2002. x      struct    timeval p_etime;    /* end time */
  2003. x  #ifndef OREO
  2004. x      struct    rusage p_rusage;
  2005. x+ #endif OREO
  2006. x      long    p_utime;    /* XXX */
  2007. x      long    p_stime;    /* XXX */
  2008. x      char    *p_command;        /* first PMAXLEN chars of command */
  2009. x*** ../csh4.2/sh.sem.c    Tue Jun 23 12:14:05 1987
  2010. x--- sh.sem.c    Mon Jun 29 17:56:18 1987
  2011. x***************
  2012. x*** 168,173
  2013. x                      sigsys(SIGINT, SIG_IGN);
  2014. x                      sigsys(SIGQUIT, SIG_IGN);
  2015. x                  }
  2016. x                  if (wanttty > 0)
  2017. x                      ioctl(FSHTTY, TIOCSPGRP, &pgrp);
  2018. x                  if (wanttty >= 0 && tpgrp >= 0)
  2019. x
  2020. x--- 168,174 -----
  2021. x                      sigsys(SIGINT, SIG_IGN);
  2022. x                      sigsys(SIGQUIT, SIG_IGN);
  2023. x                  }
  2024. x+ #ifdef BSDJOBS
  2025. x                  if (wanttty > 0)
  2026. x                      ioctl(FSHTTY, TIOCSPGRP, &pgrp);
  2027. x                  if (wanttty >= 0 && tpgrp >= 0)
  2028. x***************
  2029. x*** 172,177
  2030. x                      ioctl(FSHTTY, TIOCSPGRP, &pgrp);
  2031. x                  if (wanttty >= 0 && tpgrp >= 0)
  2032. x                      setpgrp(0, pgrp);
  2033. x                  if (tpgrp > 0)
  2034. x                      tpgrp = 0;
  2035. x                  if (t->t_dflg & FNOHUP)
  2036. x
  2037. x--- 173,179 -----
  2038. x                      ioctl(FSHTTY, TIOCSPGRP, &pgrp);
  2039. x                  if (wanttty >= 0 && tpgrp >= 0)
  2040. x                      setpgrp(0, pgrp);
  2041. x+ #endif BSDJOBS
  2042. x                  if (tpgrp > 0)
  2043. x                      tpgrp = 0;
  2044. x                  if (t->t_dflg & FNOHUP)
  2045. x*** ../csh4.2/sh.set.c    Tue Jun 23 12:14:06 1987
  2046. x--- sh.set.c    Tue Jun 30 17:19:57 1987
  2047. x***************
  2048. x*** 73,79
  2049. x  
  2050. x              HIST = *p++;
  2051. x              HISTSUB = *p;
  2052. x!         } else if (eq(vp, "user"))
  2053. x              setenv("USER", value(vp));
  2054. x          else if (eq(vp, "term"))
  2055. x              setenv("TERM", value(vp));
  2056. x
  2057. x--- 73,79 -----
  2058. x  
  2059. x              HIST = *p++;
  2060. x              HISTSUB = *p;
  2061. x!         } else if (eq(vp, "user")) {
  2062. x              setenv("USER", value(vp));
  2063. x          } else if (eq(vp, "term")) {
  2064. x              setenv("TERM", value(vp));
  2065. x***************
  2066. x*** 75,81
  2067. x              HISTSUB = *p;
  2068. x          } else if (eq(vp, "user"))
  2069. x              setenv("USER", value(vp));
  2070. x!         else if (eq(vp, "term"))
  2071. x              setenv("TERM", value(vp));
  2072. x          else if (eq(vp, "home"))
  2073. x              setenv("HOME", value(vp));
  2074. x
  2075. x--- 75,81 -----
  2076. x              HISTSUB = *p;
  2077. x          } else if (eq(vp, "user")) {
  2078. x              setenv("USER", value(vp));
  2079. x!         } else if (eq(vp, "term")) {
  2080. x              setenv("TERM", value(vp));
  2081. x              ed_Init(); /* reset the editor */
  2082. x          } else if (eq(vp, "home")) {
  2083. x***************
  2084. x*** 77,83
  2085. x              setenv("USER", value(vp));
  2086. x          else if (eq(vp, "term"))
  2087. x              setenv("TERM", value(vp));
  2088. x!         else if (eq(vp, "home"))
  2089. x              setenv("HOME", value(vp));
  2090. x      } while (p = *v++);
  2091. x  }
  2092. x
  2093. x--- 77,84 -----
  2094. x              setenv("USER", value(vp));
  2095. x          } else if (eq(vp, "term")) {
  2096. x              setenv("TERM", value(vp));
  2097. x!             ed_Init(); /* reset the editor */
  2098. x!         } else if (eq(vp, "home")) {
  2099. x              setenv("HOME", value(vp));
  2100. x          }
  2101. x      } while (p = *v++);
  2102. x***************
  2103. x*** 79,84
  2104. x              setenv("TERM", value(vp));
  2105. x          else if (eq(vp, "home"))
  2106. x              setenv("HOME", value(vp));
  2107. x      } while (p = *v++);
  2108. x  }
  2109. x  
  2110. x
  2111. x--- 80,86 -----
  2112. x              ed_Init(); /* reset the editor */
  2113. x          } else if (eq(vp, "home")) {
  2114. x              setenv("HOME", value(vp));
  2115. x+         }
  2116. x      } while (p = *v++);
  2117. x  }
  2118. x  
  2119. x***************
  2120. x*** 253,258
  2121. x      return (cp < end);
  2122. x  }
  2123. x  
  2124. x  xfree(cp)
  2125. x      char *cp;
  2126. x  {
  2127. x
  2128. x--- 255,263 -----
  2129. x      return (cp < end);
  2130. x  }
  2131. x  
  2132. x+ /* #include "malloc.h" */
  2133. x+ 
  2134. x+ /* changed 6/04/87 Paul Placeway for use with the faster malloc */
  2135. x  xfree(cp)
  2136. x      char *cp;
  2137. x  {
  2138. x***************
  2139. x*** 258,264
  2140. x  {
  2141. x      extern char end[];
  2142. x  
  2143. x!     if (cp >= end && cp < (char *) &cp)
  2144. x          cfree(cp);
  2145. x  }
  2146. x  
  2147. x
  2148. x--- 263,273 -----
  2149. x  {
  2150. x      extern char end[];
  2151. x  
  2152. x! /*    if (cp && (cp >= (char *)adjhead.q_forw) &&
  2153. x!         (cp <= (char *)adjhead.q_back))
  2154. x!         cfree(cp); */
  2155. x! 
  2156. x!     if (cp && cp >= end /* && cp < (char *) &cp */)
  2157. x          cfree(cp);
  2158. x  }
  2159. x  
  2160. xNo differences encountered
  2161. x*** ../csh4.2/sh.time.c    Tue Jun 23 12:14:07 1987
  2162. x--- sh.time.c    Sun Jun 28 23:20:49 1987
  2163. x***************
  2164. x*** 1,5
  2165. x  #ifndef lint
  2166. x! static char sccsid[] = "@(#)sh.time.c    4.4 (Berkeley) 8/11/83";
  2167. x  #endif
  2168. x  
  2169. x  #include "sh.h"
  2170. x
  2171. x--- 1,5 -----
  2172. x  #ifndef lint
  2173. x! static char *sccsid = "@(#)sh.time.c    4.4 (Berkeley) 8/11/83";
  2174. x  #endif
  2175. x  
  2176. x  #include "sh.h"
  2177. x***************
  2178. x*** 12,17
  2179. x  
  2180. x  settimes()
  2181. x  {
  2182. x      struct rusage ruch;
  2183. x  
  2184. x      gettimeofday(&time0, (struct timezone *)0);
  2185. x
  2186. x--- 12,18 -----
  2187. x  
  2188. x  settimes()
  2189. x  {
  2190. x+ #ifndef OREO
  2191. x      struct rusage ruch;
  2192. x  #endif
  2193. x  
  2194. x***************
  2195. x*** 13,18
  2196. x  settimes()
  2197. x  {
  2198. x      struct rusage ruch;
  2199. x  
  2200. x      gettimeofday(&time0, (struct timezone *)0);
  2201. x      getrusage(RUSAGE_SELF, &ru0);
  2202. x
  2203. x--- 14,20 -----
  2204. x  {
  2205. x  #ifndef OREO
  2206. x      struct rusage ruch;
  2207. x+ #endif
  2208. x  
  2209. x      gettimeofday(&time0, (struct timezone *)0);
  2210. x  #ifndef OREO
  2211. x***************
  2212. x*** 15,20
  2213. x      struct rusage ruch;
  2214. x  
  2215. x      gettimeofday(&time0, (struct timezone *)0);
  2216. x      getrusage(RUSAGE_SELF, &ru0);
  2217. x      getrusage(RUSAGE_CHILDREN, &ruch);
  2218. x      ruadd(&ru0, &ruch);
  2219. x
  2220. x--- 17,23 -----
  2221. x  #endif
  2222. x  
  2223. x      gettimeofday(&time0, (struct timezone *)0);
  2224. x+ #ifndef OREO
  2225. x      getrusage(RUSAGE_SELF, &ru0);
  2226. x      getrusage(RUSAGE_CHILDREN, &ruch);
  2227. x      ruadd(&ru0, &ruch);
  2228. x***************
  2229. x*** 18,23
  2230. x      getrusage(RUSAGE_SELF, &ru0);
  2231. x      getrusage(RUSAGE_CHILDREN, &ruch);
  2232. x      ruadd(&ru0, &ruch);
  2233. x  }
  2234. x  
  2235. x  /*
  2236. x
  2237. x--- 21,27 -----
  2238. x      getrusage(RUSAGE_SELF, &ru0);
  2239. x      getrusage(RUSAGE_CHILDREN, &ruch);
  2240. x      ruadd(&ru0, &ruch);
  2241. x+ #endif OREO
  2242. x  }
  2243. x  
  2244. x  /*
  2245. x***************
  2246. x*** 26,31
  2247. x   */
  2248. x  dotime()
  2249. x  {
  2250. x      struct timeval timedol;
  2251. x      struct rusage ru1, ruch;
  2252. x  
  2253. x
  2254. x--- 30,36 -----
  2255. x   */
  2256. x  dotime()
  2257. x  {
  2258. x+ #ifndef OREO
  2259. x      struct timeval timedol;
  2260. x      struct rusage ru1, ruch;
  2261. x  
  2262. x***************
  2263. x*** 34,39
  2264. x      ruadd(&ru1, &ruch);
  2265. x      gettimeofday(&timedol, (struct timezone *)0);
  2266. x      prusage(&ru0, &ru1, &timedol, &time0);
  2267. x  }
  2268. x  
  2269. x  /*
  2270. x
  2271. x--- 39,45 -----
  2272. x      ruadd(&ru1, &ruch);
  2273. x      gettimeofday(&timedol, (struct timezone *)0);
  2274. x      prusage(&ru0, &ru1, &timedol, &time0);
  2275. x+ #endif
  2276. x  }
  2277. x  
  2278. x  /*
  2279. x***************
  2280. x*** 60,65
  2281. x      }
  2282. x  }
  2283. x  
  2284. x  ruadd(ru, ru2)
  2285. x      register struct rusage *ru, *ru2;
  2286. x  {
  2287. x
  2288. x--- 66,72 -----
  2289. x      }
  2290. x  }
  2291. x  
  2292. x+ #ifndef OREO
  2293. x  ruadd(ru, ru2)
  2294. x      register struct rusage *ru, *ru2;
  2295. x  {
  2296. x***************
  2297. x*** 158,163
  2298. x      }
  2299. x      putchar('\n');
  2300. x  }
  2301. x  
  2302. x  pdeltat(t1, t0)
  2303. x      struct timeval *t1, *t0;
  2304. x
  2305. x--- 165,171 -----
  2306. x      }
  2307. x      putchar('\n');
  2308. x  }
  2309. x+ #endif
  2310. x  
  2311. x  pdeltat(t1, t0)
  2312. x      struct timeval *t1, *t0;
  2313. \Rogue\Monster\
  2314. else
  2315.   echo "will not over write ./DIFFS.2"
  2316. fi
  2317. if [ `wc -c ./DIFFS.2 | awk '{printf $1}'` -ne 46609 ]
  2318. then
  2319. echo `wc -c ./DIFFS.2 | awk '{print "Got " $1 ", Expected " 46609}'`
  2320. fi
  2321. echo "Finished archive 5 of 6"
  2322. # if you want to concatenate archives, remove anything after this line
  2323. exit
  2324.  
  2325. -- 
  2326.  
  2327. Rich $alz
  2328. Cronus Project, BBN Labs            rsalz@bbn.com
  2329. Moderator, comp.sources.unix            sources@uunet.uu.net
  2330.