home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / ms_sh-1.6 / patch03 < prev    next >
Encoding:
Text File  |  1990-08-29  |  16.2 KB  |  731 lines

  1. Newsgroups: comp.sources.misc
  2. from: istewart@datlog.co.uk
  3. subject: v14i066: MS-Shell Patch 1.6.3 - Part 2 of 2
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 14, Issue 66
  7. Submitted-by: istewart@datlog.co.uk
  8. Archive-name: ms_sh-1.6/patch03
  9.  
  10. #!/bin/sh
  11. # this is PA.02 (part 2 of a multipart archive)
  12. # do not concatenate these parts, unpack them in order with /bin/sh
  13. # file Patch1.6.3 continued
  14. #
  15. if touch 2>&1 | fgrep '[-amc]' > /dev/null
  16.  then TOUCH=touch
  17.  else TOUCH=true
  18. fi
  19. if test ! -r @shar_seq_.tmp; then
  20.     echo "Please unpack part 1 first!"
  21.     exit 1
  22. fi
  23. (read Scheck
  24.  if test "$Scheck" != 2; then
  25.     echo "Please unpack part $Scheck next!"
  26.     exit 1
  27.  else
  28.     exit 0
  29.  fi
  30. ) < @shar_seq_.tmp || exit 1
  31. echo "x - Continuing file Patch1.6.3"
  32. sed 's/^X//' << 'SHAR_EOF' >> Patch1.6.3 &&
  33. X--- 1293,1337 ----
  34. X   * Get a string in a malloced area
  35. X   */
  36. X  
  37. X! char        *getcell (nbytes)
  38. X  unsigned int    nbytes;
  39. X  {
  40. X      s_region        *np;
  41. X      void        (*save_signal)(int);
  42. X+ #ifdef CHECK_MALLOC
  43. X+     char        *rp;
  44. X+ #endif
  45. X  
  46. X      if (nbytes == 0)
  47. X      abort ();    /* silly and defeats the algorithm */
  48. X  
  49. X  /* Grab some space */
  50. X  
  51. X!     np = (s_region *)calloc (nbytes + sizeof (s_region)
  52. X! #ifdef CHECK_MALLOC
  53. X!                  + sizeof (unsigned int)
  54. X! #endif
  55. X!                             , 1);
  56. X  
  57. X!     if (np == (s_region *)NULL)
  58. X!         return (char *)NULL;
  59. X! 
  60. X! #ifdef CHECK_MALLOC
  61. X!     if ((((FP_SEG (np)) << 4L) + FP_OFF (np)) > 0x9fc00L)
  62. X!     {
  63. X!     free (np);
  64. X!     print_warn ("Malloc access to bad segment\n");
  65. X!     return (char *)NULL;
  66. X!     }
  67. X!     
  68. X!     np->magic1             = MAGIC1;
  69. X!     np->len               = nbytes;
  70. X!     rp                          = (char *)(np + 1);
  71. X!     *((int *)(rp + nbytes)) = MAGIC2;
  72. X! #endif
  73. X  
  74. X+ /* Disable signals */
  75. X+ 
  76. X      save_signal = signal (SIGINT, SIG_IGN);
  77. X  
  78. X  /* Link into chain */
  79. X***************
  80. X*** 1339,1345 ****
  81. X          else
  82. X          lp->next = cp->next;
  83. X  
  84. X!         free (cp);
  85. X          break;
  86. X      }
  87. X      }
  88. X--- 1386,1392 ----
  89. X          else
  90. X          lp->next = cp->next;
  91. X  
  92. X!         SH_FREE (cp);
  93. X          break;
  94. X      }
  95. X      }
  96. X***************
  97. X*** 1386,1392 ****
  98. X          cp = cp->next;
  99. X          areastart = cp;
  100. X  
  101. X!         free (lp);
  102. X          lp = (char *)NULL;
  103. X      }
  104. X  
  105. X--- 1433,1439 ----
  106. X          cp = cp->next;
  107. X          areastart = cp;
  108. X  
  109. X!         SH_FREE (lp);
  110. X          lp = (char *)NULL;
  111. X      }
  112. X  
  113. X***************
  114. X*** 1395,1401 ****
  115. X      else
  116. X      {
  117. X          lp->next = cp->next;
  118. X!         free (cp);
  119. X          cp = lp->next;
  120. X      }
  121. X      }
  122. X--- 1442,1448 ----
  123. X      else
  124. X      {
  125. X          lp->next = cp->next;
  126. X!         SH_FREE (cp);
  127. X          cp = lp->next;
  128. X      }
  129. X      }
  130. X***************
  131. X*** 1816,1822 ****
  132. X   * Convert backslashes to slashes for UNIX
  133. X   */
  134. X  
  135. X! static void    Convert_Backslashes (sp)
  136. X  char        *sp;
  137. X  {
  138. X      while (*sp)
  139. X--- 1863,1869 ----
  140. X   * Convert backslashes to slashes for UNIX
  141. X   */
  142. X  
  143. X! void        Convert_Backslashes (sp)
  144. X  char        *sp;
  145. X  {
  146. X      while (*sp)
  147. X***************
  148. X*** 1919,1921 ****
  149. X--- 1966,2178 ----
  150. X  
  151. X      return strcat (cp, name);
  152. X  }
  153. X+ 
  154. X+ /* Check alloc functions */
  155. X+ #ifdef CHECK_MALLOC
  156. X+ static void    sh_free (ap)
  157. X+ void        *ap;
  158. X+ {
  159. X+     s_region    *cp = (s_region *)ap;
  160. X+     size_t    len = cp->len;
  161. X+ 
  162. X+     if ((cp->magic1 != MAGIC1) ||
  163. X+     (*((int *)((char *)ap + len + sizeof (s_region))) != MAGIC2))
  164. X+     {
  165. X+     print_warn ("ABORT: corrupt malloc\n");
  166. X+     exit (1);
  167. X+     }
  168. X+ 
  169. X+     cp->magic1 = 0;
  170. X+     *((int *)((char *)ap + len)) = 0;
  171. X+ 
  172. X+     free (cp);
  173. X+ }
  174. X+ 
  175. X+ char        *strcat (str1, str2)
  176. X+ char        *str1;
  177. X+ const char    *str2;
  178. X+ {
  179. X+     char    *rtn = str1;
  180. X+     int        len;
  181. X+ 
  182. X+     len = strlen (str2);
  183. X+     sh_chkmem ("strcat", (char *)str2, len, FALSE);
  184. X+ 
  185. X+     if (str2 == (const char *)NULL)
  186. X+     return str1;
  187. X+ 
  188. X+     len += strlen (str1) + 1;
  189. X+     sh_chkmem ("strcat", str1, len, TRUE);
  190. X+ 
  191. X+     while (*str1)
  192. X+     str1++;
  193. X+ 
  194. X+     while ((*str1 = *str2) != 0)
  195. X+     {
  196. X+     str1++;
  197. X+     str2++;
  198. X+     }
  199. X+     
  200. X+     return rtn;
  201. X+ }
  202. X+ 
  203. X+ char        *strcpy (str1, str2)
  204. X+ char        *str1;
  205. X+ const char    *str2;
  206. X+ {
  207. X+     char    *rtn = str1;
  208. X+     int        len = strlen (str2) + 1;
  209. X+ 
  210. X+     sh_chkmem ("strcpy", str1, len, TRUE);
  211. X+ 
  212. X+     if (str2 == (const char *)NULL)
  213. X+     {
  214. X+     *str1 = 0;
  215. X+     return str1;
  216. X+     }
  217. X+ 
  218. X+     sh_chkmem ("strcpy", (char *)str2, len, FALSE);
  219. X+ 
  220. X+     while ((*str1++ = *str2++) != '\0');
  221. X+ 
  222. X+     return rtn;
  223. X+ }
  224. X+ 
  225. X+ char        *strncpy (str1, str2, len1)
  226. X+ char        *str1;
  227. X+ const char    *str2;
  228. X+ size_t        len1;
  229. X+ {
  230. X+     int        i;
  231. X+     char    *rtn = str1;
  232. X+     int        len = (int)len1;
  233. X+ 
  234. X+     sh_chkmem ("strncpy", str1, len, TRUE);
  235. X+ 
  236. X+     if (str2 == (const char *)NULL)
  237. X+     {
  238. X+     *str1 = 0;
  239. X+     return str1;
  240. X+     }
  241. X+ 
  242. X+     i = strlen (str2);
  243. X+ 
  244. X+     if (i > len)
  245. X+     i = len;
  246. X+ 
  247. X+     sh_chkmem ("strncpy", (char *)str2, i, FALSE);
  248. X+ 
  249. X+     while (--len >= 0)
  250. X+     {
  251. X+     if ((*(str1++) = *(str2++)) == 0)    
  252. X+     {
  253. X+         while (--len >= 0)
  254. X+         *(str1++) = 0;
  255. X+         
  256. X+         break;
  257. X+     }
  258. X+     }
  259. X+ 
  260. X+     return rtn;
  261. X+ }
  262. X+ 
  263. X+ void        *memcpy (rtn, ptr2a, len)
  264. X+ void        *rtn;
  265. X+ const void    *ptr2a;
  266. X+ size_t        len;
  267. X+ {
  268. X+     char    *ptr1 = rtn;
  269. X+     char    *ptr2 = (char *)ptr2a;
  270. X+ 
  271. X+     sh_chkmem ("memcpy", ptr1, len, TRUE);
  272. X+     sh_chkmem ("memcpy", ptr2, len, FALSE);
  273. X+ 
  274. X+     if (len > 1200)
  275. X+     print_warn ("Warning: string length excessive\n");
  276. X+ 
  277. X+     while (--len >= 0)
  278. X+     *(ptr1++) = *(ptr2++);
  279. X+ 
  280. X+     return rtn;
  281. X+ }
  282. X+ 
  283. X+ void    *memset (rtn, ch, len)
  284. X+ void    *rtn;
  285. X+ int    ch;
  286. X+ size_t    len;
  287. X+ {
  288. X+     char    *ptr1 = rtn;
  289. X+ 
  290. X+     sh_chkmem ("memset", ptr1, len, TRUE);
  291. X+ 
  292. X+     if (len > 1200)
  293. X+     print_warn ("Warning: string length excessive\n");
  294. X+ 
  295. X+     while (--len >= 0)
  296. X+     *(ptr1++) = (char)ch;
  297. X+ 
  298. X+     return rtn;
  299. X+ }
  300. X+ 
  301. X+ static void    sh_chkmem (f, s, l, wflag)
  302. X+ char        *f;
  303. X+ char        *s;
  304. X+ size_t        l;
  305. X+ bool        wflag;
  306. X+ {
  307. X+     register s_region    *cp = areastart;
  308. X+     s_region        *lp = (s_region *)NULL;
  309. X+     s_region        *sp = (s_region *)(s - sizeof (s_region));
  310. X+     unsigned long    cadd;
  311. X+     unsigned long    cadd1 = (unsigned long)etext << 4L;
  312. X+ 
  313. X+     cadd = ((FP_SEG (s)) << 4L) + FP_OFF (s);
  314. X+ 
  315. X+     if ((cadd == 0L) || (wflag && (s == null)))
  316. X+     {
  317. X+     print_warn ("%s: access to NULL segment\n", f);
  318. X+ 
  319. X+     if (wflag)
  320. X+         exit (1);
  321. X+     }
  322. X+ 
  323. X+     if (cadd < cadd1)
  324. X+     print_warn ("warning - %s: access to text segment\n", f);
  325. X+ 
  326. X+     if (l < 0)
  327. X+     {
  328. X+     print_warn ("%s: bad length %d\n", f, l);
  329. X+     exit (1);
  330. X+     }
  331. X+ 
  332. X+     if (s != (char *)NULL)
  333. X+     {
  334. X+     while (cp != (s_region *)NULL)
  335. X+     {
  336. X+         if (cp != sp)
  337. X+         {
  338. X+         lp = cp;
  339. X+         cp = cp->next;
  340. X+         continue;
  341. X+         }
  342. X+ 
  343. X+ /* Found it, check the length and other things */
  344. X+ 
  345. X+         if ((cp->magic1 != MAGIC1) ||
  346. X+         (*((int *)(s + cp->len)) != MAGIC2))
  347. X+         {
  348. X+         print_warn ("%s: access to deleted block\n", f);
  349. X+         exit (1);
  350. X+         }
  351. X+ 
  352. X+         if (l > cp->len)
  353. X+         {
  354. X+         print_warn ("%s: bad length %d\n", f, l);
  355. X+         exit (1);
  356. X+         }
  357. X+ 
  358. X+         return;
  359. X+     }
  360. X+     }
  361. X+ }
  362. X+ #endif
  363. XIndex: shell/sh10.c
  364. XPrereq: 1.3
  365. X*** ../sh16.2/shell/sh10.c    Thu Jun 21 21:46:42 1990
  366. X--- shell/sh10.c    Fri Aug 17 21:32:51 1990
  367. X***************
  368. X*** 12,20 ****
  369. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  370. X   *     (or parts of sources) cannot be sold under any circumstances.
  371. X   *
  372. X!  *    $Header: sh10.c 1.3 90/05/31 09:51:06 MS_user Exp $
  373. X   *
  374. X   *    $Log:    sh10.c $
  375. X   * Revision 1.3  90/05/31  09:51:06  MS_user
  376. X   * Add some signal lockouts to prevent corruption
  377. X   * 
  378. X--- 12,24 ----
  379. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  380. X   *     (or parts of sources) cannot be sold under any circumstances.
  381. X   *
  382. X!  *    $Header: C:/SRC/SHELL/RCS/sh10.c 1.4 90/08/14 23:33:32 MS_user Exp $
  383. X   *
  384. X   *    $Log:    sh10.c $
  385. X+  * Revision 1.4  90/08/14  23:33:32  MS_user
  386. X+  * Fix memory bugs - Add Copy function code to code a function tree
  387. X+  * before it is executed.
  388. X+  * 
  389. X   * Revision 1.3  90/05/31  09:51:06  MS_user
  390. X   * Add some signal lockouts to prevent corruption
  391. X   * 
  392. X***************
  393. X*** 40,49 ****
  394. X  #include <stdlib.h>
  395. X  #include <fcntl.h>
  396. X  #include <limits.h>
  397. X  #include "sh.h"
  398. X  
  399. X- /* Function declarations */
  400. X  
  401. X  static void    Print_Command (C_Op *);
  402. X  static void    Print_IO (IO_Actions *);
  403. X  static void    Print_Case (C_Op *);
  404. X--- 44,55 ----
  405. X  #include <stdlib.h>
  406. X  #include <fcntl.h>
  407. X  #include <limits.h>
  408. X+ #include <dirent.h>
  409. X  #include "sh.h"
  410. X  
  411. X  
  412. X+ /* Function declarations */
  413. X+ 
  414. X  static void    Print_Command (C_Op *);
  415. X  static void    Print_IO (IO_Actions *);
  416. X  static void    Print_Case (C_Op *);
  417. X***************
  418. X*** 51,58 ****
  419. X--- 57,68 ----
  420. X  static void    Set_Free_ExTree (C_Op *, void (*)(char *));
  421. X  static void    Set_Free_Command (C_Op *, void (*)(char *));
  422. X  static void    Set_Free_Case (C_Op *, void (*)(char *));
  423. X+ static C_Op    *Copy_ExTree (C_Op *);
  424. X+ static void    Copy_Command (C_Op *, C_Op *);
  425. X+ static C_Op    *Copy_Case (C_Op *);
  426. X  static void    Set_ExTree (char *);
  427. X  static void    Free_ExTree (char *);
  428. X+ static void    *field_dup (void *, size_t);
  429. X  
  430. X  static int    Print_indent;            /* Current indent level    */
  431. X  
  432. X***************
  433. X*** 628,631 ****
  434. X--- 638,840 ----
  435. X      (*func)((char *)t1->words);
  436. X  
  437. X      Set_Free_ExTree (t1->left, func);
  438. X+ }
  439. X+ 
  440. X+ /*
  441. X+  * Copy function tree area by recursively processing of tree
  442. X+  */
  443. X+ 
  444. X+ static C_Op    *Copy_ExTree (Old_t)
  445. X+ C_Op        *Old_t;
  446. X+ {
  447. X+     char    **wp;
  448. X+     C_Op    *New_t;
  449. X+     Word_B    *wb = (Word_B *)NULL;
  450. X+ 
  451. X+     if (Old_t == (C_Op *)NULL)
  452. X+     return (C_Op *)NULL;
  453. X+ 
  454. X+     New_t = (C_Op *) field_dup (Old_t, sizeof (C_Op));
  455. X+ 
  456. X+ /* Check for start of print */
  457. X+ 
  458. X+     if (Old_t->type == TFUNC)
  459. X+     {
  460. X+     New_t->words = (char **)getcell (sizeof (char *) * 2);
  461. X+     *New_t->words = strsave (*Old_t->words, areanum);
  462. X+     New_t->left = Copy_ExTree (Old_t->left);
  463. X+     }
  464. X+ 
  465. X+ /* Otherwise, process the tree and print it */
  466. X+ 
  467. X+     switch (Old_t->type) 
  468. X+     {
  469. X+     case TPAREN:            /* ()            */
  470. X+     case TCOM:            /* A command process    */
  471. X+         Copy_Command (Old_t, New_t);
  472. X+         break;
  473. X+ 
  474. X+     case TPIPE:            /* Pipe processing        */
  475. X+     case TLIST:            /* Entries in a for statement    */
  476. X+     case TOR:            /* || and &&            */
  477. X+     case TAND:
  478. X+     case TWHILE:            /* WHILE and UNTIL functions    */
  479. X+     case TUNTIL:
  480. X+         New_t->left  = Copy_ExTree (Old_t->left);
  481. X+         New_t->right = Copy_ExTree (Old_t->right);
  482. X+         break;
  483. X+ 
  484. X+     case TFOR:            /* First part of a for statement*/
  485. X+         New_t->str = strsave (Old_t->str, areanum);
  486. X+ 
  487. X+         if ((wp = Old_t->words) != (char **)NULL)
  488. X+         {
  489. X+         while (*wp != (char *)NULL)
  490. X+             wb = addword (strsave (*(wp++), areanum), wb);
  491. X+ 
  492. X+         New_t->words = getwords (addword ((char *)NULL, wb));
  493. X+         }
  494. X+ 
  495. X+         New_t->left = Copy_ExTree (Old_t->left);
  496. X+         break;
  497. X+ 
  498. X+     case TIF:            /* IF and ELSE IF functions    */
  499. X+     case TELIF:
  500. X+         if (Old_t->right != (C_Op *)NULL)
  501. X+         {
  502. X+         New_t->right = (C_Op *)field_dup (Old_t->right, sizeof (C_Op));
  503. X+         New_t->right->left  = Copy_ExTree (Old_t->right->left);
  504. X+         New_t->right->right = Copy_ExTree (Old_t->right->right);
  505. X+         }
  506. X+ 
  507. X+     case TBRACE:            /* {} statement            */
  508. X+         New_t->left = Copy_ExTree (Old_t->left);
  509. X+         break;
  510. X+ 
  511. X+     case TCASE:            /* CASE function        */
  512. X+         New_t->str = strsave (Old_t->str, areanum);
  513. X+         New_t->left = Copy_Case (Old_t->left);
  514. X+         break;
  515. X+     }
  516. X+ 
  517. X+     return New_t;
  518. X+ }
  519. X+ 
  520. X+ /*
  521. X+  * Copy a command line
  522. X+  */
  523. X+ 
  524. X+ static void    Copy_Command (Old_t, New_t)
  525. X+ C_Op        *Old_t, *New_t;
  526. X+ {
  527. X+     IO_Actions    **iopp;
  528. X+     char    **wp = Old_t->words;
  529. X+     Word_B    *wb = (Word_B *)NULL;
  530. X+     IO_Actions    *iop;
  531. X+ 
  532. X+ /* Parenthesis ? */
  533. X+ 
  534. X+     if (Old_t->type == TPAREN)
  535. X+     New_t->left = Copy_ExTree (Old_t->left);
  536. X+ 
  537. X+     else
  538. X+     {
  539. X+     while (*wp != (char *)NULL)
  540. X+         wb = addword (strsave (*(wp++), areanum), wb);
  541. X+ 
  542. X+     New_t->words = getwords (addword ((char *)NULL, wb));
  543. X+     }
  544. X+ 
  545. X+ /* Process up any IO required */
  546. X+ 
  547. X+     if ((iopp = Old_t->ioact) != (IO_Actions **)NULL) 
  548. X+     {
  549. X+     wb = (Word_B *)NULL;
  550. X+ 
  551. X+     while (*iopp != (IO_Actions *)NULL)
  552. X+     {
  553. X+         iop = (IO_Actions *)field_dup (*iopp, sizeof (IO_Actions));
  554. X+         iop->io_name = strsave ((*iopp)->io_name, areanum);
  555. X+         wb = addword ((char *)iop, wb);
  556. X+         ++iopp;
  557. X+     }
  558. X+ 
  559. X+      New_t->ioact = (IO_Actions **)getwords (addword ((char *)NULL, wb));
  560. X+     }
  561. X+ }
  562. X+ 
  563. X+ /*
  564. X+  * Copy the contents of a case statement
  565. X+  */
  566. X+ 
  567. X+ static C_Op    *Copy_Case (Old_t)
  568. X+ C_Op        *Old_t;
  569. X+ {
  570. X+     register C_Op    *Old_t1, *New_t, *New_t1;
  571. X+     register char    **wp;
  572. X+     Word_B        *wb = (Word_B *)NULL;
  573. X+ 
  574. X+     if (Old_t == (C_Op *)NULL)
  575. X+     return (C_Op *)NULL;
  576. X+ 
  577. X+ /* type - TLIST - go down the left tree first and then processes this level */
  578. X+ 
  579. X+     New_t = (C_Op *)field_dup (Old_t, sizeof (C_Op));
  580. X+ 
  581. X+     if (Old_t->type == TLIST) 
  582. X+     {
  583. X+     New_t->left  = Copy_Case (Old_t->left);
  584. X+     New_t->right = (C_Op *)field_dup (Old_t->right, sizeof (C_Op));
  585. X+     Old_t1         = Old_t->right;
  586. X+     New_t1         = New_t->right;
  587. X+     }
  588. X+     
  589. X+     else
  590. X+     {
  591. X+     New_t1 = New_t;
  592. X+     Old_t1 = Old_t;
  593. X+     }
  594. X+ 
  595. X+ /* Duplicate the word block */
  596. X+ 
  597. X+     wp = Old_t1->words;
  598. X+ 
  599. X+     while (*wp != (char *)NULL)
  600. X+     wb = addword (strsave (*(wp++), areanum), wb);
  601. X+ 
  602. X+     New_t1->words = getwords (addword ((char *)NULL, wb));
  603. X+     New_t1->left  = Copy_ExTree (Old_t1->left);
  604. X+     return New_t;
  605. X+ }
  606. X+ 
  607. X+ 
  608. X+ /*
  609. X+  * Duplicate a field 
  610. X+  */
  611. X+ 
  612. X+ static void    *field_dup (source, size)
  613. X+ void        *source;
  614. X+ size_t        size;
  615. X+ {
  616. X+     return memcpy (space (size), source, size);
  617. X+ }
  618. X+ 
  619. X+ /* Duplicate the tree */
  620. X+ 
  621. X+ C_Op        *Copy_Function (Old_t)
  622. X+ C_Op        *Old_t;
  623. X+ {
  624. X+     int        *save_errpt;
  625. X+     jmp_buf    new_errpt;
  626. X+     C_Op    *New_t = (C_Op *)NULL;
  627. X+ 
  628. X+ /* Set up for error handling - like out of space */
  629. X+ 
  630. X+     save_errpt = e.errpt;
  631. X+ 
  632. X+     if (setjmp (new_errpt) == 0)
  633. X+     New_t = Copy_ExTree (Old_t);
  634. X+ 
  635. X+     e.errpt = save_errpt;
  636. X+     return New_t; 
  637. X  }
  638. XIndex: shell/sh2.c
  639. XPrereq: 1.5
  640. X*** ../sh16.2/shell/sh2.c    Thu Jun 21 21:47:05 1990
  641. X--- shell/sh2.c    Fri Aug 17 21:34:11 1990
  642. X***************
  643. X*** 13,21 ****
  644. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  645. X   *     (or parts of sources) cannot be sold under any circumstances.
  646. X   *
  647. X!  *    $Header: sh2.c 1.5 90/04/25 09:18:38 MS_user Exp $
  648. X   *
  649. X   *    $Log:    sh2.c $
  650. X   * Revision 1.5  90/04/25  09:18:38  MS_user
  651. X   * Fix for ... do to not require terminating colon
  652. X   * 
  653. X--- 13,24 ----
  654. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  655. X   *     (or parts of sources) cannot be sold under any circumstances.
  656. X   *
  657. X!  *    $Header: C:/SRC/SHELL/RCS/sh2.c 1.6 90/08/14 23:30:26 Ian_Stewartson Exp $
  658. X   *
  659. X   *    $Log:    sh2.c $
  660. X+  * Revision 1.6  90/08/14  23:30:26  Ian_Stewartson
  661. X+  * Add support for read/write IO
  662. X+  * 
  663. X   * Revision 1.5  90/04/25  09:18:38  MS_user
  664. X   * Fix for ... do to not require terminating colon
  665. X   * 
  666. X***************
  667. X*** 42,47 ****
  668. X--- 45,52 ----
  669. X  #include <string.h>
  670. X  #include <ctype.h>
  671. X  #include <unistd.h>
  672. X+ #include <limits.h>
  673. X+ #include <dirent.h>
  674. X  #include "sh.h"
  675. X  
  676. X  /*
  677. X***************
  678. X*** 886,898 ****
  679. X  {
  680. X      register int    c;
  681. X  
  682. X      if (((c = Getc (0)) == '>') || (c == '<'))
  683. X      {
  684. X-     if (c != ec)
  685. X-         yyerror (syntax_err);
  686. X  
  687. X!     yylval.i = (ec == '>') ? IOWRITE | IOCAT : IOHERE;
  688. X!     c = Getc(0);
  689. X      }
  690. X      
  691. X      else
  692. X--- 891,915 ----
  693. X  {
  694. X      register int    c;
  695. X  
  696. X+ /* Get the next character to see if it is a re-direction character as well */
  697. X+ 
  698. X      if (((c = Getc (0)) == '>') || (c == '<'))
  699. X      {
  700. X  
  701. X! /* Check for open in read/write mode */
  702. X! 
  703. X!     if ((ec == '<') && (c == '>'))
  704. X!         yylval.i = IOWRITE | IOREAD;
  705. X! 
  706. X! /* Otherwise, we must have a double character */
  707. X! 
  708. X!     else if (c != ec)
  709. X!         yyerror (syntax_err);
  710. X! 
  711. X!     else
  712. X!         yylval.i = (ec == '>') ? IOWRITE | IOCAT : IOHERE;
  713. X! 
  714. X!     c = Getc (0);
  715. X      }
  716. X      
  717. X      else
  718. SHAR_EOF
  719. echo "File Patch1.6.3 is complete" &&
  720. $TOUCH -am 0820110190 Patch1.6.3 &&
  721. chmod 0644 Patch1.6.3 ||
  722. echo "restore of Patch1.6.3 failed"
  723. set `wc -c Patch1.6.3`;Wc_c=$1
  724. if test "$Wc_c" != "51095"; then
  725.     echo original size 51095, current size $Wc_c
  726. fi
  727. rm -f @shar_seq_.tmp
  728. echo "You have unpacked the last part"
  729. exit 0
  730.  
  731.