home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / ms_sh16.lzh / ms_sh.1 next >
Text File  |  1990-05-06  |  40KB  |  1,419 lines

  1.  
  2. #!/bin/sh
  3. # shar:    Shell Archiver  (v1.23)
  4. #
  5. # This is a shell archive, meaning:
  6. # 1. Remove everything above the #! /bin/sh line.
  7. # 2. Save the resulting text in a file.
  8. # 3. Execute the file with /bin/sh (not csh) to create the files.
  9. #
  10. # This is part 1 of a multipart archive                                    
  11. # do not concatenate these parts, unpack them in order with /bin/sh        
  12. #
  13. #    The following text will create:
  14. #      Patch1.5
  15. #      Patch1.6
  16. #      Notes1.6
  17. #      Notes1.5
  18. #      Patch.Lib
  19. #      ms_dio.2
  20. #      scripts/sh.ini
  21. #
  22. if test -r s2_seq_.tmp
  23. then echo "Must unpack archives in sequence!"
  24.      next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
  25.      exit 1; fi
  26. echo "x - extracting Patch1.5 (Text)"
  27. sed 's/^X//' << 'SHAR_EOF' > Patch1.5 &&
  28. XIndex: ReadMe
  29. XPrereq: 1.1
  30. X*** ../sh14/ReadMe    Mon Feb 19 14:13:41 1990
  31. X--- ReadMe    Fri Feb 16 19:07:39 1990
  32. X***************
  33. X*** 1,4 ****
  34. X!  MS-DOS Shell Version 1.4    README                January 1990
  35. X  
  36. X   MS-DOS SHELL - Copyright (c) 1990 Data Logic Limited and Charles Forsyth
  37. X  
  38. X--- 1,4 ----
  39. X!  MS-DOS Shell Version 1.5    README                February 1990
  40. X  
  41. X   MS-DOS SHELL - Copyright (c) 1990 Data Logic Limited and Charles Forsyth
  42. X  
  43. X***************
  44. X*** 13,24 ****
  45. X   2.  The sources (or parts thereof) or objects generated from the
  46. X       sources (or parts of sources) cannot be sold under any circumstances.
  47. X  
  48. X!     $Header: readme 1.1 90/01/25 13:43:20 MS_user Exp $
  49. X  
  50. X      $Log:    readme $
  51. X! # Revision 1.1  90/01/25  13:43:20  MS_user
  52. X! # Initial revision
  53. X! # 
  54. X  ________________________________________________________________________________
  55. X  
  56. X  This is an implementation of the Unix Shell for MSDOS.  As far as
  57. X--- 13,30 ----
  58. X   2.  The sources (or parts thereof) or objects generated from the
  59. X       sources (or parts of sources) cannot be sold under any circumstances.
  60. X  
  61. X!     $Header: readme 1.3 90/02/16 16:58:10 MS_user Exp $
  62. X  
  63. X      $Log:    readme $
  64. X!     Revision 1.3  90/02/16  16:58:10  MS_user
  65. X!     Set up 1.5 release
  66. X!     
  67. X!     Revision 1.2  90/02/14  04:53:20  MS_user
  68. X!     Interrupt 24 note
  69. X!     
  70. X!     Revision 1.1  90/01/25  13:43:20  MS_user
  71. X!     Initial revision
  72. X!     
  73. X  ________________________________________________________________________________
  74. X  
  75. X  This is an implementation of the Unix Shell for MSDOS.  As far as
  76. X***************
  77. X*** 76,81 ****
  78. X--- 82,91 ----
  79. X  
  80. X  7)  Wild cards on drives (ie echo *:*.c will echo all the C files in 
  81. X      the current directories of each drive) are supported.
  82. X+ 
  83. X+ 8)  Interrupt 24 processing has been added.
  84. X+ 
  85. X+ The shell was built using MS-DOS C and MASM v5.1 in large model mode.
  86. X  
  87. X  In order to rebuild this program, you need the DIRECTORY(3) functions
  88. X  for MSDOS (also included) and the version of open in your library must
  89. XIndex: sh.1
  90. XPrereq: 1.1
  91. X*** ../sh14/sh.1    Mon Feb 19 14:24:22 1990
  92. X--- sh.1    Fri Feb 16 19:07:02 1990
  93. X***************
  94. X*** 13,21 ****
  95. X  .\" 2.  The sources (or parts thereof) or objects generated from the sources
  96. X  .\"     (or parts of sources) cannot be sold under any circumstances.
  97. X  .\"
  98. X! .\"    $Header: sh.1 1.1 90/01/24 14:17:00 MS_user Locked $
  99. X  .\"
  100. X  .\"    $Log:    sh.1 $
  101. X  .\"    Revision 1.1  90/01/24  14:17:00  MS_user
  102. X  .\"    Initial revision
  103. X  .\"    
  104. X--- 13,24 ----
  105. X  .\" 2.  The sources (or parts thereof) or objects generated from the sources
  106. X  .\"     (or parts of sources) cannot be sold under any circumstances.
  107. X  .\"
  108. X! .\"    $Header: sh.1 1.2 90/02/16 16:58:27 MS_user Exp $
  109. X  .\"
  110. X  .\"    $Log:    sh.1 $
  111. X+ .\"    Revision 1.2  90/02/16  16:58:27  MS_user
  112. X+ .\"    Set up 1.5 release
  113. X+ .\"    
  114. X  .\"    Revision 1.1  90/01/24  14:17:00  MS_user
  115. X  .\"    Initial revision
  116. X  .\"    
  117. X***************
  118. X*** 23,29 ****
  119. X  .\"
  120. X  .ds OK [\|
  121. X  .ds CK \|]
  122. X! .TH SH 1L "Data Logic Limited" "MS-DOS Version 1.4"
  123. X  .SH NAME
  124. X  sh, rsh - shell, the standard/restricted command programming language
  125. X  .SH SYNOPSIS
  126. X--- 26,32 ----
  127. X  .\"
  128. X  .ds OK [\|
  129. X  .ds CK \|]
  130. X! .TH SH 1L "Data Logic Limited" "MS-DOS Version 1.5"
  131. X  .SH NAME
  132. X  sh, rsh - shell, the standard/restricted command programming language
  133. X  .SH SYNOPSIS
  134. XIndex: sh.h
  135. XPrereq: 1.1
  136. X*** ../sh14/sh.h    Mon Feb 19 16:47:24 1990
  137. X--- sh.h    Fri Feb 16 19:03:36 1990
  138. X***************
  139. X*** 13,27 ****
  140. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  141. X   *     (or parts of sources) cannot be sold under any circumstances.
  142. X   *
  143. X!  *    $Header: sh.h 1.1 90/01/29 17:46:51 MS_user Exp $
  144. X   *
  145. X   *    $Log:    sh.h $
  146. X   * Revision 1.1  90/01/29  17:46:51  MS_user
  147. X   * Initial revision
  148. X   * 
  149. X   * 
  150. X   */
  151. X  
  152. X  #define    LINE_MAX    1000    /* Command line length            */
  153. X  #define HISTORY_MAX    100    /* History array length            */
  154. X                  /* Space for full file name        */
  155. X--- 13,34 ----
  156. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  157. X   *     (or parts of sources) cannot be sold under any circumstances.
  158. X   *
  159. X!  *    $Header: sh.h 1.3 90/02/16 16:58:48 MS_user Exp $
  160. X   *
  161. X   *    $Log:    sh.h $
  162. X+  * Revision 1.3  90/02/16  16:58:48  MS_user
  163. X+  * Set up 1.5 release
  164. X+  * 
  165. X+  * Revision 1.2  90/02/14  04:45:33  MS_user
  166. X+  * Add Interrupt 24 processing and clean up interrupt 0 and 23 processing
  167. X+  * 
  168. X   * Revision 1.1  90/01/29  17:46:51  MS_user
  169. X   * Initial revision
  170. X   * 
  171. X   * 
  172. X   */
  173. X  
  174. X+ #define PATCHLEVEL    1
  175. X  #define    LINE_MAX    1000    /* Command line length            */
  176. X  #define HISTORY_MAX    100    /* History array length            */
  177. X                  /* Space for full file name        */
  178. X***************
  179. X*** 124,133 ****
  180. X  extern unsigned int    SW_intr;    /* interrupt pending        */
  181. X  extern unsigned int    SW_Blocks;    /* Number of blocks to read    */
  182. X  extern int        SW_fp;        /* File or EMS Handler        */
  183. X- extern unsigned int    SW_I0_V_BX;    /* Out interrupt Zero address    */
  184. X- extern unsigned int    SW_I0_V_ES;
  185. X- extern unsigned int    SW_I23_V_ES;    /* Our Interrupt 23 address    */
  186. X- extern unsigned int    SW_I23_V_BX;
  187. X  extern unsigned long    SW_EMstart;    /* Start addr of extend mem    */
  188. X  extern unsigned int    SW_Mode;    /* Type of swapping to do    */
  189. X                      /* 1 - disk            */
  190. X--- 131,136 ----
  191. X***************
  192. X*** 523,525 ****
  193. X--- 526,537 ----
  194. X  extern void    Restore_Environment (int, int);
  195. X  extern int    sort_compare (char **, char **);
  196. X  extern int    Check_Script (char *);
  197. X+ 
  198. X+ /*
  199. X+  * Interrupt handling
  200. X+  */
  201. X+ 
  202. X+ extern void interrupt    SW_Int24 (void);    /* Int 24 New address    */
  203. X+ extern void (interrupt far *SW_I24_V) (void);    /*      Old address    */
  204. X+ extern void (interrupt far *SW_I0_V) (void);    /* Int 0 address    */
  205. X+ extern void (interrupt far *SW_I23_V) (void);    /* Int 23 address    */
  206. XIndex: sh0.asm
  207. XPrereq: 1.1
  208. X*** ../sh14/sh0.asm    Mon Feb 19 16:46:08 1990
  209. X--- sh0.asm    Fri Feb 16 19:13:56 1990
  210. X***************
  211. X*** 18,26 ****
  212. X  ; 2.  The sources (or parts thereof) or objects generated from the sources
  213. X  ;     (or parts of sources) cannot be sold under any circumstances.
  214. X  ;
  215. X! ;    $Header: sh0.asm 1.1 90/01/25 13:43:36 MS_user Exp $
  216. X  ;
  217. X  ;    $Log:    sh0.asm $
  218. X  ;    Revision 1.1  90/01/25  13:43:36  MS_user
  219. X  ;    Initial revision
  220. X  ;    
  221. X--- 18,29 ----
  222. X  ; 2.  The sources (or parts thereof) or objects generated from the sources
  223. X  ;     (or parts of sources) cannot be sold under any circumstances.
  224. X  ;
  225. X! ;    $Header: sh0.asm 1.2 90/02/14 04:45:58 MS_user Exp $
  226. X  ;
  227. X  ;    $Log:    sh0.asm $
  228. X+ ;    Revision 1.2  90/02/14  04:45:58  MS_user
  229. X+ ;    Add Interrupt 24 processing and clean up interrupt 0 and 23 processing
  230. X+ ;    
  231. X  ;    Revision 1.1  90/01/25  13:43:36  MS_user
  232. X  ;    Initial revision
  233. X  ;    
  234. X***************
  235. X*** 67,88 ****
  236. X          public    _SW_intr
  237. X          public    _SW_Blocks
  238. X          public    _SW_fp
  239. X!         public    _SW_I0_V_BX
  240. X!         public    _SW_I0_V_ES
  241. X!         public    _SW_I23_V_ES
  242. X!         public    _SW_I23_V_BX
  243. X          public    _SW_EMstart
  244. X          public    _SW_Mode
  245. X          public    _SW_EMSFrame
  246. X  
  247. X  _cmd_line    db    129 dup (?)    ; Command line
  248. X  _path_line    db    80 dup (?)    ; Path line
  249. X  _SW_Blocks    dw    0        ; Number of blocks to read/write
  250. X  _SW_fp        dw    0        ; File ID
  251. X! _SW_I23_V_ES    dw    0        ; Interrupt 23 address
  252. X! _SW_I23_V_BX    dw    0
  253. X! _SW_I0_V_BX    dw    0        ; Our Interrupt zero value
  254. X! _SW_I0_V_ES    dw    0
  255. X  _SW_EMstart    dd    0100000H    ; Default Extended Mem start
  256. X  _SW_Mode    dw    0        ; Type of swapping to do
  257. X                      ;   1 - disk
  258. X--- 70,90 ----
  259. X          public    _SW_intr
  260. X          public    _SW_Blocks
  261. X          public    _SW_fp
  262. X!         public    _SW_I0_V
  263. X!         public    _SW_I23_V
  264. X!         public    _SW_I24_V 
  265. X          public    _SW_EMstart
  266. X          public    _SW_Mode
  267. X          public    _SW_EMSFrame
  268. X+         public    _SW_Int24
  269. X  
  270. X  _cmd_line    db    129 dup (?)    ; Command line
  271. X  _path_line    db    80 dup (?)    ; Path line
  272. X  _SW_Blocks    dw    0        ; Number of blocks to read/write
  273. X  _SW_fp        dw    0        ; File ID
  274. X! _SW_I0_V    dd    0        ; Our Interrupt Zero address
  275. X! _SW_I23_V    dd    0        ; Our Interrupt 23 address
  276. X! _SW_I24_V     dd    0        ; Original Interrupt 24 address
  277. X  _SW_EMstart    dd    0100000H    ; Default Extended Mem start
  278. X  _SW_Mode    dw    0        ; Type of swapping to do
  279. X                      ;   1 - disk
  280. X***************
  281. X*** 91,97 ****
  282. X  _SW_EMSFrame    dw    0        ; EMS Frame segment
  283. X  _SW_intr    dw    0        ; Interrupt 23 detected.
  284. X  
  285. X- 
  286. X  ;
  287. X  ; Some addition variables
  288. X  ;
  289. X--- 93,98 ----
  290. X***************
  291. X*** 514,520 ****
  292. X  ;  Check for interrupt 23 detected
  293. X  ;
  294. X      mov    ax, word ptr cs:_SW_intr
  295. X!     xor    ax, ax
  296. X      jz    $I23_Cf            ; No - continue;
  297. X  
  298. X  ;
  299. X--- 515,521 ----
  300. X  ;  Check for interrupt 23 detected
  301. X  ;
  302. X      mov    ax, word ptr cs:_SW_intr
  303. X!     or    ax, ax
  304. X      jz    $I23_Cf            ; No - continue;
  305. X  
  306. X  ;
  307. X***************
  308. X*** 527,534 ****
  309. X      sti
  310. X  
  311. X      mov    ds, word ptr cs:S_ds    ; Restore DS
  312. X!     mov    word ptr ds:_errno, 4    ; Set to EINTR
  313. X!     jmp    $Exec_Error
  314. X  
  315. X  ;
  316. X  ; No interrupts - continue
  317. X--- 528,535 ----
  318. X      sti
  319. X  
  320. X      mov    ds, word ptr cs:S_ds    ; Restore DS
  321. X!     xor    ax, ax
  322. X!     jmp    $Exec_Complete
  323. X  
  324. X  ;
  325. X  ; No interrupts - continue
  326. X***************
  327. X*** 729,741 ****
  328. X  $SA_spawn_Exit:
  329. X      push    ax                ; Save exit code
  330. X      mov    ax, 02523H            ; Set Control C Interrupt
  331. X!     mov    ds, word ptr cs:_SW_I23_V_ES
  332. X!     mov    dx, word ptr cs:_SW_I23_V_BX
  333. X      int    021H
  334. X  
  335. X!     mov    ax, 02523H            ; Set Divide Zero Interrupt
  336. X!     mov    ds, word ptr cs:_SW_I0_V_ES
  337. X!     mov    dx, word ptr cs:_SW_I0_V_BX
  338. X  
  339. X  ;
  340. X  
  341. X--- 730,742 ----
  342. X  $SA_spawn_Exit:
  343. X      push    ax                ; Save exit code
  344. X      mov    ax, 02523H            ; Set Control C Interrupt
  345. X!     mov    dx, word ptr cs:_SW_I23_V
  346. X!     mov    ds, word ptr cs:_SW_I23_V + 2
  347. X      int    021H
  348. X  
  349. X!     mov    ax, 02500H            ; Set Divide Zero Interrupt
  350. X!     mov    dx, word ptr cs:_SW_I0_V
  351. X!     mov    ds, word ptr cs:_SW_I0_V + 2
  352. X  
  353. X  ;
  354. X  
  355. X***************
  356. X*** 983,1003 ****
  357. X  ;
  358. X  
  359. X  SA_IRET        proc    far
  360. X!     push    ax
  361. X!     push    bp            ; Save the AX and DS registers
  362. X!     push    ds
  363. X!     mov    bp, seg SH0_TEXT    ; Get my segment
  364. X!     mov    ds, bp
  365. X!     inc    word ptr ds:_SW_intr    ; Set Interrupt 23 detected.
  366. X!     cmp    byte ptr ds:InShell, 0    ; Are we in the shell ?
  367. X      jz    $SA_Ins
  368. X  
  369. X  ; In another program - move the stack around
  370. X  
  371. X-     mov    bp, sp
  372. X-     pop    ds            ; Unstack values
  373. X-     pop    bp
  374. X-     pop    ax
  375. X      stc
  376. X      ret
  377. X  
  378. X--- 984,995 ----
  379. X  ;
  380. X  
  381. X  SA_IRET        proc    far
  382. X!     inc    word ptr cs:_SW_intr    ; Set Interrupt 23 detected.
  383. X!     cmp    byte ptr cs:InShell, 0    ; Are we in the shell ?
  384. X      jz    $SA_Ins
  385. X  
  386. X  ; In another program - move the stack around
  387. X  
  388. X      stc
  389. X      ret
  390. X  
  391. X***************
  392. X*** 1005,1013 ****
  393. X  ; In shell - ignore interrupt 23 for the moment
  394. X  
  395. X  $SA_Ins:
  396. X-     pop    ds            ; Restore regs
  397. X-     pop    bp
  398. X-     pop    ax
  399. X      iret
  400. X  
  401. X  SA_IRET        endp
  402. X--- 997,1002 ----
  403. X***************
  404. X*** 1028,1033 ****
  405. X--- 1017,1054 ----
  406. X      int    021H
  407. X  
  408. X  SA_DZERO    endp
  409. X+ 
  410. X+ ;
  411. X+ ; INTERRUPT 24 - ERROR HANDLER - Output message
  412. X+ ;
  413. X+ 
  414. X+ _SW_Int24    proc    far
  415. X+     pushf                ; Save flags
  416. X+     call    dword ptr cs:_SW_I24_V 
  417. X+ 
  418. X+     cmp    byte ptr cs:InShell, 0    ; Are we in the shell ? 
  419. X+     jnz    $SW_int24c        ; No - no processing
  420. X+ 
  421. X+     test    ah, 010h
  422. X+     jnz    $SW_int24a
  423. X+     test    ah, 008h
  424. X+     jnz    $SW_int24b
  425. X+ 
  426. X+     mov    al, 003h        ; Fail system call
  427. X+ 
  428. X+ $SW_int24c:
  429. X+     iret
  430. X+ 
  431. X+ ;
  432. X+ $SW_int24a:
  433. X+     xor    al, al            ; Ignore error
  434. X+     iret
  435. X+ 
  436. X+ ;
  437. X+ $SW_int24b:
  438. X+     mov    al, 001h        ; Retry error
  439. X+     iret
  440. X+ _SW_Int24    endp
  441. X  
  442. X  ;
  443. X  ;  Start of overwrite area for environment.  Align on a paragraph
  444. XIndex: sh1.c
  445. XPrereq: 1.1
  446. X*** ../sh14/sh1.c    Mon Feb 19 16:09:18 1990
  447. X--- sh1.c    Fri Feb 16 19:12:27 1990
  448. X***************
  449. X*** 13,21 ****
  450. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  451. X   *     (or parts of sources) cannot be sold under any circumstances.
  452. X   *
  453. X!  *    $Header: sh1.c 1.1 90/01/25 13:40:39 MS_user Exp $
  454. X   *
  455. X   *    $Log:    sh1.c $
  456. X   * Revision 1.1  90/01/25  13:40:39  MS_user
  457. X   * Initial revision
  458. X   * 
  459. X--- 13,24 ----
  460. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  461. X   *     (or parts of sources) cannot be sold under any circumstances.
  462. X   *
  463. X!  *    $Header: sh1.c 1.2 90/02/14 04:46:20 MS_user Exp $
  464. X   *
  465. X   *    $Log:    sh1.c $
  466. X+  * Revision 1.2  90/02/14  04:46:20  MS_user
  467. X+  * Add Interrupt 24 processing
  468. X+  * 
  469. X   * Revision 1.1  90/01/25  13:40:39  MS_user
  470. X   * Initial revision
  471. X   * 
  472. X***************
  473. X*** 1522,1527 ****
  474. X--- 1525,1538 ----
  475. X  /* Patch the ctype table as a cheat */
  476. X  
  477. X      (_ctype+1)['_'] |= _UPPER;
  478. X+ 
  479. X+ /* Save the interrupt 24 address */
  480. X+ 
  481. X+     SW_I24_V = _dos_getvect (0x24);
  482. X+ 
  483. X+ /* Set the newinterrupt 24 address */
  484. X+ 
  485. X+     _dos_setvect (0x24, SW_Int24);
  486. X  }
  487. X  
  488. X  /*
  489. XIndex: sh3.c
  490. XPrereq: 1.1
  491. X*** ../sh14/sh3.c    Mon Feb 19 16:24:02 1990
  492. X--- sh3.c    Fri Feb 16 19:10:04 1990
  493. X***************
  494. X*** 13,21 ****
  495. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  496. X   *     (or parts of sources) cannot be sold under any circumstances.
  497. X   *
  498. X!  *    $Header: sh3.c 1.1 90/01/25 13:41:24 MS_user Exp $
  499. X   *
  500. X   *    $Log:    sh3.c $
  501. X   * Revision 1.1  90/01/25  13:41:24  MS_user
  502. X   * Initial revision
  503. X   * 
  504. X--- 13,24 ----
  505. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  506. X   *     (or parts of sources) cannot be sold under any circumstances.
  507. X   *
  508. X!  *    $Header: sh3.c 1.2 90/02/14 04:47:06 MS_user Exp $
  509. X   *
  510. X   *    $Log:    sh3.c $
  511. X+  * Revision 1.2  90/02/14  04:47:06  MS_user
  512. X+  * Clean up Interrupt 23 and 0 processing, change EMS version error message
  513. X+  * 
  514. X   * Revision 1.1  90/01/25  13:41:24  MS_user
  515. X   * Initial revision
  516. X   * 
  517. X***************
  518. X*** 1116,1135 ****
  519. X  
  520. X  /* Save the interrupt 0 address */
  521. X  
  522. X!     or.x.ax = 0x3500;
  523. X!     intdosx (&or, &or, &sr);
  524. X  
  525. X-     SW_I0_V_BX = or.x.bx;
  526. X-     SW_I0_V_ES = sr.es;
  527. X- 
  528. X  /* Save the interrupt 23 address */
  529. X  
  530. X!     or.x.ax = 0x3523;
  531. X!     intdosx (&or, &or, &sr);
  532. X  
  533. X-     SW_I23_V_BX = or.x.bx;
  534. X-     SW_I23_V_ES = sr.es;
  535. X- 
  536. X  /* Get max Extended memory pages, and convert to 16K blocks.  If Extended
  537. X   * memory swapping disabled, set to zero
  538. X   */
  539. X--- 1119,1130 ----
  540. X  
  541. X  /* Save the interrupt 0 address */
  542. X  
  543. X!     SW_I0_V = _dos_getvect (0x00);
  544. X  
  545. X  /* Save the interrupt 23 address */
  546. X  
  547. X!     SW_I23_V = _dos_getvect (0x23);
  548. X  
  549. X  /* Get max Extended memory pages, and convert to 16K blocks.  If Extended
  550. X   * memory swapping disabled, set to zero
  551. X   */
  552. X***************
  553. X*** 1174,1180 ****
  554. X  
  555. X      if ((or.h.ah != 0) || (or.h.al < 0x32))
  556. X      {
  557. X!     EMS_error (EMS_emsg, or.h.ah);
  558. X      return;
  559. X      }
  560. X  
  561. X--- 1169,1175 ----
  562. X  
  563. X      if ((or.h.ah != 0) || (or.h.al < 0x32))
  564. X      {
  565. X!     EMS_error ("Warning: EMS Version < 3.2\n", 0);
  566. X      return;
  567. X      }
  568. X  
  569. XIndex: sh6.c
  570. XPrereq: 1.1
  571. X*** ../sh14/sh6.c    Mon Feb 19 16:33:18 1990
  572. X--- sh6.c    Fri Feb 16 19:07:19 1990
  573. X***************
  574. X*** 13,21 ****
  575. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  576. X   *     (or parts of sources) cannot be sold under any circumstances.
  577. X   *
  578. X!  *    $Header: sh6.c 1.1 90/01/25 13:42:04 MS_user Exp $
  579. X   *
  580. X   *    $Log:    sh6.c $
  581. X   * Revision 1.1  90/01/25  13:42:04  MS_user
  582. X   * Initial revision
  583. X   * 
  584. X--- 13,24 ----
  585. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  586. X   *     (or parts of sources) cannot be sold under any circumstances.
  587. X   *
  588. X!  *    $Header: sh6.c 1.2 90/02/16 16:58:22 MS_user Exp $
  589. X   *
  590. X   *    $Log:    sh6.c $
  591. X+  * Revision 1.2  90/02/16  16:58:22  MS_user
  592. X+  * Set up 1.5 release
  593. X+  * 
  594. X   * Revision 1.1  90/01/25  13:42:04  MS_user
  595. X   * Initial revision
  596. X   * 
  597. X***************
  598. X*** 31,37 ****
  599. X  #include <unistd.h>
  600. X  #include "sh.h"
  601. X  
  602. X! char        *Copy_Right1 = "MS-DOS SH Version 1.4\341 (DOS %d.%d)\n";
  603. X  char        *Copy_Right2 = "Copyright (c) Data Logic Ltd and Charles Forsyth 1990\n";
  604. X  char        **dolv;        /* Parameter array            */
  605. X  int        dolc;        /* Number of entries in parameter array    */
  606. X--- 34,40 ----
  607. X  #include <unistd.h>
  608. X  #include "sh.h"
  609. X  
  610. X! char        *Copy_Right1 = "MS-DOS SH Version 1.5\341 (DOS %d.%d)\n";
  611. X  char        *Copy_Right2 = "Copyright (c) Data Logic Ltd and Charles Forsyth 1990\n";
  612. X  char        **dolv;        /* Parameter array            */
  613. X  int        dolc;        /* Number of entries in parameter array    */
  614. XIndex: sh7.c
  615. XPrereq: 1.1
  616. X*** ../sh14/sh7.c    Mon Feb 19 16:36:26 1990
  617. X--- sh7.c    Fri Feb 16 19:16:21 1990
  618. X***************
  619. X*** 3,9 ****
  620. X   * MS-DOS SHELL - Copyright (c) 1990 Data Logic Limited and Charles Forsyth
  621. X   *
  622. X   * This code is based on (in part) the shell program written by Charles
  623. X!  * Forsyth and is subject to the following copyright restrictions:
  624. X   *
  625. X   * 1.  Redistribution and use in source and binary forms are permitted
  626. X   *     provided that the above copyright notice is duplicated in the
  627. X--- 3,11 ----
  628. X   * MS-DOS SHELL - Copyright (c) 1990 Data Logic Limited and Charles Forsyth
  629. X   *
  630. X   * This code is based on (in part) the shell program written by Charles
  631. X!  * Forsyth and is subject to the following copyright restrictions.  The
  632. X!  * code for the test (dotest) command was based on code written by
  633. X!  * Erik Baalbergen.  The following copyright conditions apply:
  634. X   *
  635. X   * 1.  Redistribution and use in source and binary forms are permitted
  636. X   *     provided that the above copyright notice is duplicated in the
  637. X***************
  638. X*** 13,21 ****
  639. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  640. X   *     (or parts of sources) cannot be sold under any circumstances.
  641. X   *
  642. X!  *    $Header: sh7.c 1.1 90/01/29 17:46:25 MS_user Exp $
  643. X   *
  644. X   *    $Log:    sh7.c $
  645. X   * Revision 1.1  90/01/29  17:46:25  MS_user
  646. X   * Initial revision
  647. X   * 
  648. X--- 15,26 ----
  649. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  650. X   *     (or parts of sources) cannot be sold under any circumstances.
  651. X   *
  652. X!  *    $Header: sh7.c 1.2 90/01/30 14:43:34 MS_user Exp $
  653. X   *
  654. X   *    $Log:    sh7.c $
  655. X+  * Revision 1.2  90/01/30  14:43:34  MS_user
  656. X+  * Add missing author note
  657. X+  * 
  658. X   * Revision 1.1  90/01/29  17:46:25  MS_user
  659. X   * Initial revision
  660. X   * 
  661. XIndex: sh9.c
  662. XPrereq: 1.1
  663. X*** ../sh14/sh9.c    Mon Feb 19 16:42:18 1990
  664. X--- sh9.c    Mon Feb 19 15:49:13 1990
  665. X***************
  666. X*** 12,24 ****
  667. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  668. X   *     (or parts of sources) cannot be sold under any circumstances.
  669. X   *
  670. X!  *    $Header: sh9.c 1.1 90/01/26 17:25:19 MS_user Exp $
  671. X   *
  672. X   *    $Log:    sh9.c $
  673. X   * Revision 1.1  90/01/26  17:25:19  MS_user
  674. X   * Initial revision
  675. X!  * 
  676. X!  * 
  677. X   */
  678. X  
  679. X  #include <sys/types.h>
  680. X--- 12,27 ----
  681. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  682. X   *     (or parts of sources) cannot be sold under any circumstances.
  683. X   *
  684. X!  *    $Header: sh9.c 1.2 90/02/19 15:42:39 MS_user Exp $
  685. X   *
  686. X   *    $Log:    sh9.c $
  687. X+  * Revision 1.2  90/02/19  15:42:39  MS_user
  688. X+  * Remove dependency on ANSI.SYS
  689. X+  * 
  690. X   * Revision 1.1  90/01/26  17:25:19  MS_user
  691. X   * Initial revision
  692. X!  *
  693. X!  *
  694. X   */
  695. X  
  696. X  #include <sys/types.h>
  697. X***************
  698. X*** 47,68 ****
  699. X  static bool    UpDate_CLine (char *);
  700. X  static bool    Re_start (char *);
  701. X  static void    memrcpy (char *, char *, int);
  702. X! static int    read_cursor_position (void);
  703. X  static void    set_cursor_position (int);
  704. X  static void    gen_cursor_position (void);
  705. X  
  706. X  static bool    insert_mode = FALSE;
  707. X  static char    *c_buffer_pos;        /* Position in command line    */
  708. X  static char    *end_buffer;        /* End of command line        */
  709. X  static int    s_cursor;        /* Start cursor position    */
  710. X  static int    c_history = -1;        /* Current entry        */
  711. X  static int    l_history = 0;        /* End of history array        */
  712. X  static int    M_length = -1;        /* Match length            */
  713. X  static char    l_buffer[LINE_MAX + 1];
  714. X! static char    *No_prehistory   = "history: No previous commands\033[2K\n";
  715. X! static char    *No_MatchHistory = "history: No history match found\033[2K\n";
  716. X! static char    *No_posthistory  = "history: No more commands\033[2K\n";
  717. X! static char    *History_2long   = "history: History line too long\033[2K\n";
  718. X  static char    *H_TooLongI = "History file line too long - ignored (%d)\n";
  719. X  
  720. X  /* Arrary of history Items */
  721. X--- 50,73 ----
  722. X  static bool    UpDate_CLine (char *);
  723. X  static bool    Re_start (char *);
  724. X  static void    memrcpy (char *, char *, int);
  725. X! static void    read_cursor_position (void);
  726. X  static void    set_cursor_position (int);
  727. X  static void    gen_cursor_position (void);
  728. X+ static void    erase_to_end_of_line (void);
  729. X  
  730. X  static bool    insert_mode = FALSE;
  731. X  static char    *c_buffer_pos;        /* Position in command line    */
  732. X  static char    *end_buffer;        /* End of command line        */
  733. X  static int    s_cursor;        /* Start cursor position    */
  734. X+ static int    m_line = 0;        /* Max write line number    */
  735. X  static int    c_history = -1;        /* Current entry        */
  736. X  static int    l_history = 0;        /* End of history array        */
  737. X  static int    M_length = -1;        /* Match length            */
  738. X  static char    l_buffer[LINE_MAX + 1];
  739. X! static char    *No_prehistory   = "history: No previous commands";
  740. X! static char    *No_MatchHistory = "history: No history match found";
  741. X! static char    *No_posthistory  = "history: No more commands";
  742. X! static char    *History_2long   = "history: History line too long";
  743. X  static char    *H_TooLongI = "History file line too long - ignored (%d)\n";
  744. X  
  745. X  /* Arrary of history Items */
  746. X***************
  747. X*** 129,135 ****
  748. X      end_buffer = l_buffer;
  749. X      insert_mode = FALSE;
  750. X      M_length = -1;
  751. X!     s_cursor = read_cursor_position ();
  752. X  
  753. X      while (((i = getch ()) != 0x1a) && (i != NL) && (i != '\r'))
  754. X      {
  755. X--- 134,140 ----
  756. X      end_buffer = l_buffer;
  757. X      insert_mode = FALSE;
  758. X      M_length = -1;
  759. X!     read_cursor_position ();
  760. X  
  761. X      while (((i = getch ()) != 0x1a) && (i != NL) && (i != '\r'))
  762. X      {
  763. X***************
  764. X*** 156,162 ****
  765. X          v1a_puts (l_buffer);
  766. X          break;
  767. X      }
  768. X!     
  769. X      else if (*l_buffer != '!')
  770. X          break;
  771. X  
  772. X--- 161,167 ----
  773. X          v1a_puts (l_buffer);
  774. X          break;
  775. X      }
  776. X! 
  777. X      else if (*l_buffer != '!')
  778. X          break;
  779. X  
  780. X***************
  781. X*** 372,385 ****
  782. X  
  783. X  /* Read Cursor position */
  784. X  
  785. X! static int    read_cursor_position ()
  786. X  {
  787. X      union REGS    r;
  788. X  
  789. X      r.h.ah = 0x03;                /* Read cursor position    */
  790. X      r.h.bh = 0;                    /* Page zero        */
  791. X      int86 (0x10, &r, &r);
  792. X!     return (r.h.dh * 80) + r.h.dl;
  793. X  }
  794. X  
  795. X  /* Re-position the cursor */
  796. X--- 377,391 ----
  797. X  
  798. X  /* Read Cursor position */
  799. X  
  800. X! static void    read_cursor_position ()
  801. X  {
  802. X      union REGS    r;
  803. X  
  804. X      r.h.ah = 0x03;                /* Read cursor position    */
  805. X      r.h.bh = 0;                    /* Page zero        */
  806. X      int86 (0x10, &r, &r);
  807. X!     s_cursor = (r.h.dh * 80) + r.h.dl;
  808. X!     m_line = r.h.dh;
  809. X  }
  810. X  
  811. X  /* Re-position the cursor */
  812. X***************
  813. X*** 402,412 ****
  814. X      s_cursor -= 80;
  815. X      }
  816. X  
  817. X      int86 (0x10, &r, &r);
  818. X  }
  819. X  
  820. X! /* Generate the new cursor position */
  821. X  
  822. X  static void    gen_cursor_position ()
  823. X  {
  824. X      char    *cp = l_buffer - 1;
  825. X--- 408,439 ----
  826. X      s_cursor -= 80;
  827. X      }
  828. X  
  829. X+     if (m_line < r.h.dh)
  830. X+     m_line = r.h.dh;
  831. X+ 
  832. X      int86 (0x10, &r, &r);
  833. X  }
  834. X  
  835. X! /* Erase to end of line (avoid need for STUPID ansi.sys memory eater!) */
  836. X  
  837. X+ static void    erase_to_end_of_line ()
  838. X+ {
  839. X+     union REGS    r;
  840. X+ 
  841. X+     r.h.ah = 0x03;
  842. X+     r.h.bh = 0;
  843. X+     int86 (0x10, &r, &r);
  844. X+ 
  845. X+     if ((r.x.cx = 80 - r.h.dl + (m_line - r.h.dh) * 80) > 0)
  846. X+     {
  847. X+     r.x.ax = 0x0920;
  848. X+     r.x.bx = 0x0007;
  849. X+     int86 (0x10, &r, &r);
  850. X+     }
  851. X+ }
  852. X+ 
  853. X+ /* Generate the new cursor position */
  854. X+ 
  855. X  static void    gen_cursor_position ()
  856. X  {
  857. X      char    *cp = l_buffer - 1;
  858. X***************
  859. X*** 471,477 ****
  860. X      ++cp;
  861. X      }
  862. X  
  863. X!     v1_puts ("\033[2K");        /* clear to end of line    */
  864. X  }
  865. X  
  866. X  /* Process history command
  867. X--- 498,504 ----
  868. X      ++cp;
  869. X      }
  870. X  
  871. X!     erase_to_end_of_line ();        /* clear to end of line    */
  872. X  }
  873. X  
  874. X  /* Process history command
  875. X***************
  876. X*** 531,540 ****
  877. X  
  878. X          while (isspace (*optionals))
  879. X          ++optionals;
  880. X-         
  881. X  
  882. X- /* Copy selected item into line buffer */
  883. X  
  884. X      case 2:
  885. X          M_length = strlen (l_buffer) - 1;
  886. X          if (!Scan_History ())
  887. X--- 558,567 ----
  888. X  
  889. X          while (isspace (*optionals))
  890. X          ++optionals;
  891. X  
  892. X  
  893. X+ /* Copy selected item into line buffer */
  894. X+ 
  895. X      case 2:
  896. X          M_length = strlen (l_buffer) - 1;
  897. X          if (!Scan_History ())
  898. X***************
  899. X*** 562,568 ****
  900. X  
  901. X      if (end_buffer > optionals)
  902. X      memrcpy (end_buffer + 1 + opt_len, optionals + opt_len, opt_len + 1);
  903. X!     
  904. X      else
  905. X      strcpy (end_buffer + 1, optionals);
  906. X  
  907. X--- 589,595 ----
  908. X  
  909. X      if (end_buffer > optionals)
  910. X      memrcpy (end_buffer + 1 + opt_len, optionals + opt_len, opt_len + 1);
  911. X! 
  912. X      else
  913. X      strcpy (end_buffer + 1, optionals);
  914. X  
  915. X***************
  916. X*** 816,822 ****
  917. X--- 843,853 ----
  918. X  char        *cp;
  919. X  {
  920. X      if (cp != (char *)NULL)
  921. X+     {
  922. X      print_warn (cp);
  923. X+     erase_to_end_of_line ();
  924. X+     v1_putc (NL);
  925. X+     }
  926. X  
  927. X      put_prompt (last_prompt);
  928. X  
  929. X***************
  930. X*** 824,830 ****
  931. X  
  932. X      c_buffer_pos = l_buffer;
  933. X      end_buffer = l_buffer;
  934. X!     s_cursor = read_cursor_position ();
  935. X  
  936. X      return FALSE;
  937. X  }
  938. X--- 855,861 ----
  939. X  
  940. X      c_buffer_pos = l_buffer;
  941. X      end_buffer = l_buffer;
  942. X!     read_cursor_position ();
  943. X  
  944. X      return FALSE;
  945. X  }
  946. SHAR_EOF
  947. chmod 0644 Patch1.5 || echo "restore of Patch1.5 fails"
  948. set `wc -c Patch1.5`;Sum=$1
  949. if test "$Sum" != "24187"
  950. then echo original size 24187, current size $Sum;fi
  951. echo "x - extracting Patch1.6 (Text)"
  952. sed 's/^X//' << 'SHAR_EOF' > Patch1.6 &&
  953. XIndex: lib/popen.c
  954. X*** ../sh15/lib/popen.c    Fri Mar  2 11:34:14 1990
  955. X--- lib/popen.c    Mon Apr 30 22:51:53 1990
  956. X***************
  957. X*** 17,44 ****
  958. X      char    *p_file;        /* Pipe file name        */
  959. X      int        p_status;        /* Status for close to return    */
  960. X                      /* Read pipes only        */
  961. X!     bool    p_write;        /* Read or write        */
  962. X  } PIPE;
  963. X  
  964. X  static PIPE    P_list[_NFILE];        /* The pipe structures        */
  965. X  static int    Pipes_Inited = 0;    /* Initialised ?        */
  966. X  static int    Unique_Pipe  = 0;
  967. X  
  968. X! static PIPE    *_p_save_entry (char *, bool);
  969. X  static int    _p_run (char *);
  970. X  static int    _p_reset_entry (PIPE *, int);
  971. X  static PIPE    *_p_get_entry (FILE *);
  972. X  
  973. X  /* Set up a pipe structure */
  974. X  
  975. X  static PIPE    *_p_save_entry (prog, mode)
  976. X  char        *prog;
  977. X! bool        mode;
  978. X  {
  979. X      FILE    *fp;        /* File handler                */
  980. X      PIPE    *pp;        /* Pipe handler structure        */
  981. X      char    tmpfile[NAME_MAX + PATH_MAX + 2];
  982. X      char    *tmpdir;    /* Points to directory prefix of pipe    */
  983. X  
  984. X  /* Find out where we should put temporary files */
  985. X  
  986. X--- 17,46 ----
  987. X      char    *p_file;        /* Pipe file name        */
  988. X      int        p_status;        /* Status for close to return    */
  989. X                      /* Read pipes only        */
  990. X!     char    p_write;        /* Read or write        */
  991. X  } PIPE;
  992. X  
  993. X  static PIPE    P_list[_NFILE];        /* The pipe structures        */
  994. X  static int    Pipes_Inited = 0;    /* Initialised ?        */
  995. X  static int    Unique_Pipe  = 0;
  996. X  
  997. X! static PIPE    *_p_save_entry (char *, char *);
  998. X  static int    _p_run (char *);
  999. X  static int    _p_reset_entry (PIPE *, int);
  1000. X  static PIPE    *_p_get_entry (FILE *);
  1001. X+ static int    _p_onexit (void);
  1002. X  
  1003. X  /* Set up a pipe structure */
  1004. X  
  1005. X  static PIPE    *_p_save_entry (prog, mode)
  1006. X  char        *prog;
  1007. X! char        *mode;
  1008. X  {
  1009. X      FILE    *fp;        /* File handler                */
  1010. X      PIPE    *pp;        /* Pipe handler structure        */
  1011. X      char    tmpfile[NAME_MAX + PATH_MAX + 2];
  1012. X      char    *tmpdir;    /* Points to directory prefix of pipe    */
  1013. X+     char    s_mode = *mode;
  1014. X  
  1015. X  /* Find out where we should put temporary files */
  1016. X  
  1017. X***************
  1018. X*** 52,65 ****
  1019. X  
  1020. X  /* Get a unique pipe file name */
  1021. X  
  1022. X!     sprintf (tmpfile, "%s/pipe%05d.tmp", tmpdir, Unique_Pipe++);
  1023. X      unlink (tmpfile);
  1024. X  
  1025. X  /* Create the pipe */
  1026. X  
  1027. X!     if ((fp = fopen (tmpfile, "w")) == (FILE *) NULL)
  1028. X!     return (PIPE *)NULL;
  1029. X  
  1030. X  /* Create the PIPE entry */
  1031. X  
  1032. X      if ((pp = _p_get_entry ((FILE *)NULL)) == (PIPE *)NULL)
  1033. X--- 54,71 ----
  1034. X  
  1035. X  /* Get a unique pipe file name */
  1036. X  
  1037. X!     sprintf (tmpfile, "%s/pipe%.4x.tmp", tmpdir, Unique_Pipe++);
  1038. X      unlink (tmpfile);
  1039. X  
  1040. X  /* Create the pipe */
  1041. X  
  1042. X!     *mode = 'w';
  1043. X!     fp = fopen (tmpfile, mode);
  1044. X!     *mode = s_mode;
  1045. X  
  1046. X+     if (fp == (FILE *) NULL)
  1047. X+     return (PIPE *)NULL;
  1048. X+ 
  1049. X  /* Create the PIPE entry */
  1050. X  
  1051. X      if ((pp = _p_get_entry ((FILE *)NULL)) == (PIPE *)NULL)
  1052. X***************
  1053. X*** 73,79 ****
  1054. X  /* Set up the entry */
  1055. X  
  1056. X      pp->p_fp      = fp;
  1057. X!     pp->p_write   = mode;
  1058. X      pp->p_process = strdup (prog);
  1059. X      pp->p_file    = strdup (tmpfile);
  1060. X  
  1061. X--- 79,85 ----
  1062. X  /* Set up the entry */
  1063. X  
  1064. X      pp->p_fp      = fp;
  1065. X!     pp->p_write   = *mode;
  1066. X      pp->p_process = strdup (prog);
  1067. X      pp->p_file    = strdup (tmpfile);
  1068. X  
  1069. X***************
  1070. X*** 121,127 ****
  1071. X      shell = ++bp;
  1072. X  
  1073. X      if (strcmp (shell, "command.com"))
  1074. X!     *dash = '-';
  1075. X  
  1076. X  /* Run the program */
  1077. X  
  1078. X--- 127,133 ----
  1079. X      shell = ++bp;
  1080. X  
  1081. X      if (strcmp (shell, "command.com"))
  1082. X!     *dash = '/';
  1083. X  
  1084. X  /* Run the program */
  1085. X  
  1086. X***************
  1087. X*** 199,210 ****
  1088. X      {
  1089. X      memset (&P_list[0], 0, sizeof (P_list));
  1090. X      Pipes_Inited = 1;
  1091. X-     }
  1092. X  
  1093. X  /* For write style pipe, pclose handles program execution */
  1094. X  
  1095. X!     if (strcmp (type, "w") == 0)
  1096. X!     return ((pp = _p_save_entry (command, TRUE)) == (PIPE *)NULL)
  1097. X             ? (FILE *)NULL : pp->p_fp;
  1098. X      
  1099. X  /* read pipe must create tmp file, set up stdout to point to the temp
  1100. X--- 205,219 ----
  1101. X      {
  1102. X      memset (&P_list[0], 0, sizeof (P_list));
  1103. X      Pipes_Inited = 1;
  1104. X  
  1105. X+     if (onexit (_p_onexit) == (onexit_t)NULL)
  1106. X+         return (FILE *)NULL;
  1107. X+     }
  1108. X+ 
  1109. X  /* For write style pipe, pclose handles program execution */
  1110. X  
  1111. X!     if (*type == 'w')
  1112. X!     return ((pp = _p_save_entry (command, type)) == (PIPE *)NULL)
  1113. X             ? (FILE *)NULL : pp->p_fp;
  1114. X      
  1115. X  /* read pipe must create tmp file, set up stdout to point to the temp
  1116. X***************
  1117. X*** 213,228 ****
  1118. X   * fine.
  1119. X   */
  1120. X  
  1121. X!     else if (strcmp (type, "r") == 0)
  1122. X      {
  1123. X!     if ((pp = _p_save_entry (command, FALSE)) == (PIPE *)NULL)
  1124. X         return (FILE *)NULL;
  1125. X  
  1126. X  /* Save the stdout file descriptor, dup the pipe onto standard out,
  1127. X   * execute the command, close the pipe and re-open it 
  1128. X   */
  1129. X  
  1130. X!     if ((old_stdout = dup (fileno(stdout)) < 0)        ||
  1131. X          (dup2 (fileno (pp->p_fp), fileno(stdout)) < 0)    ||
  1132. X          ((pp->p_status = _p_run (command)) < 0)        ||
  1133. X          (fclose (pp->p_fp) < 0)                ||
  1134. X--- 222,237 ----
  1135. X   * fine.
  1136. X   */
  1137. X  
  1138. X!     else if (*type == 'r')
  1139. X      {
  1140. X!     if ((pp = _p_save_entry (command, type)) == (PIPE *)NULL)
  1141. X         return (FILE *)NULL;
  1142. X  
  1143. X  /* Save the stdout file descriptor, dup the pipe onto standard out,
  1144. X   * execute the command, close the pipe and re-open it 
  1145. X   */
  1146. X  
  1147. X!     if (((old_stdout = dup (fileno(stdout))) < 0)        ||
  1148. X          (dup2 (fileno (pp->p_fp), fileno(stdout)) < 0)    ||
  1149. X          ((pp->p_status = _p_run (command)) < 0)        ||
  1150. X          (fclose (pp->p_fp) < 0)                ||
  1151. X***************
  1152. X*** 264,270 ****
  1153. X   * descriptor to stdin, execute the command, and then restore stdin
  1154. X   */
  1155. X  
  1156. X!     if (pp->p_write &&
  1157. X      (    ((pp->p_fp = fopen (pp->p_file, "r")) == (FILE *)NULL)    ||
  1158. X          ((old_stdin = dup (fileno (stdin))) < 0)        ||
  1159. X          (dup2 (fileno (pp->p_fp), fileno (stdin)) < 0)        ||
  1160. X--- 273,279 ----
  1161. X   * descriptor to stdin, execute the command, and then restore stdin
  1162. X   */
  1163. X  
  1164. X!     if ((pp->p_write == 'w') &&
  1165. X      (    ((pp->p_fp = fopen (pp->p_file, "r")) == (FILE *)NULL)    ||
  1166. X          ((old_stdin = dup (fileno (stdin))) < 0)        ||
  1167. X          (dup2 (fileno (pp->p_fp), fileno (stdin)) < 0)        ||
  1168. X***************
  1169. X*** 277,280 ****
  1170. X--- 286,304 ----
  1171. X  /* Close the temp file and remove it */
  1172. X  
  1173. X      return _p_reset_entry (pp, 0);
  1174. X+ }
  1175. X+ 
  1176. X+ /* Clean up on exit, in case a pipe has not been processed */
  1177. X+ 
  1178. X+ static int    _p_onexit ()
  1179. X+ {
  1180. X+     int        i;
  1181. X+ 
  1182. X+     for (i = 0; i < _NFILE; i++)
  1183. X+     {
  1184. X+     if (P_list[i].p_fp != (FILE *)NULL)
  1185. X+         pclose (P_list[i].p_fp);
  1186. X+     }
  1187. X+ 
  1188. X+     return 0;
  1189. X  }
  1190. XIndex: shell/sh6.c
  1191. XPrereq: 1.2
  1192. X*** ../sh15/shell/sh6.c    Fri Feb 16 19:07:19 1990
  1193. X--- shell/sh6.c    Tue May  1 19:49:19 1990
  1194. X***************
  1195. X*** 13,21 ****
  1196. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  1197. X   *     (or parts of sources) cannot be sold under any circumstances.
  1198. X   *
  1199. X!  *    $Header: sh6.c 1.2 90/02/16 16:58:22 MS_user Exp $
  1200. X   *
  1201. X   *    $Log:    sh6.c $
  1202. X   * Revision 1.2  90/02/16  16:58:22  MS_user
  1203. X   * Set up 1.5 release
  1204. X   * 
  1205. X--- 13,48 ----
  1206. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  1207. X   *     (or parts of sources) cannot be sold under any circumstances.
  1208. X   *
  1209. X!  *    $Header: sh6.c 1.11 90/04/25 22:38:47 MS_user Exp $
  1210. X   *
  1211. X   *    $Log:    sh6.c $
  1212. X+  * Revision 1.11  90/04/25  22:38:47  MS_user
  1213. X+  * Add initialisation for new field in IO_Args
  1214. X+  * 
  1215. X+  * Revision 1.10  90/04/25  09:20:39  MS_user
  1216. X+  * Change version message processing
  1217. X+  * 
  1218. X+  * Revision 1.9  90/04/11  12:57:12  MS_user
  1219. X+  * Update release date
  1220. X+  * 
  1221. X+  * Revision 1.8  90/04/06  17:17:46  MS_user
  1222. X+  * RELEASE 1.6!
  1223. X+  * 
  1224. X+  * Revision 1.7  90/03/26  20:55:36  MS_user
  1225. X+  * Move to beta test version
  1226. X+  * 
  1227. X+  * Revision 1.6  90/03/12  20:34:07  MS_user
  1228. X+  * Add save program name variable for initialisation file
  1229. X+  * 
  1230. X+  * Revision 1.5  90/03/06  15:13:48  MS_user
  1231. X+  * Set up for alpha release
  1232. X+  * 
  1233. X+  * Revision 1.4  90/03/05  13:52:31  MS_user
  1234. X+  * Change in environment structure
  1235. X+  * 
  1236. X+  * Revision 1.3  90/02/22  16:38:56  MS_user
  1237. X+  * Add XMS support
  1238. X+  * 
  1239. X   * Revision 1.2  90/02/16  16:58:22  MS_user
  1240. X   * Set up 1.5 release
  1241. X   * 
  1242. X***************
  1243. X*** 26,47 ****
  1244. X  
  1245. X  #include <sys/types.h>
  1246. X  #include <stddef.h>
  1247. X  #include <signal.h>
  1248. X  #include <errno.h>
  1249. X  #include <setjmp.h>
  1250. X  #include <stdlib.h>
  1251. X  #include <limits.h>
  1252. X  #include <unistd.h>
  1253. X  #include "sh.h"
  1254. X  
  1255. X! char        *Copy_Right1 = "MS-DOS SH Version 1.5\341 (DOS %d.%d)\n";
  1256. X! char        *Copy_Right2 = "Copyright (c) Data Logic Ltd and Charles Forsyth 1990\n";
  1257. X  char        **dolv;        /* Parameter array            */
  1258. X  int        dolc;        /* Number of entries in parameter array    */
  1259. X  int        exstat;        /* Exit status                */
  1260. X  char        gflg;
  1261. X  int        fn_area_number = -1;    /* Next function area number    */
  1262. X! int        talking;    /* interactive (talking-type wireless)    */
  1263. X  int        execflg;    /* Exec mode                */
  1264. X  int        multiline;    /* \n changed to ;            */
  1265. X  int        Current_Event = 0;    /* Current history event    */
  1266. X--- 53,76 ----
  1267. X  
  1268. X  #include <sys/types.h>
  1269. X  #include <stddef.h>
  1270. X+ #include <stdio.h>
  1271. X  #include <signal.h>
  1272. X  #include <errno.h>
  1273. X  #include <setjmp.h>
  1274. X  #include <stdlib.h>
  1275. X  #include <limits.h>
  1276. X  #include <unistd.h>
  1277. X+ #include <string.h>
  1278. X  #include "sh.h"
  1279. X  
  1280. X! static char    *Copy_Right1 = "MS-DOS SH Version 1.6 - %s (DOS %d.%d)\n";
  1281. X! static char    *Copy_Right2 = "Copyright (c) Data Logic Ltd and Charles Forsyth 1990\n";
  1282. X  char        **dolv;        /* Parameter array            */
  1283. X  int        dolc;        /* Number of entries in parameter array    */
  1284. X  int        exstat;        /* Exit status                */
  1285. X  char        gflg;
  1286. X  int        fn_area_number = -1;    /* Next function area number    */
  1287. X! bool        talking = FALSE;/* interactive (talking-type wireless)    */
  1288. X  int        execflg;    /* Exec mode                */
  1289. X  int        multiline;    /* \n changed to ;            */
  1290. X  int        Current_Event = 0;    /* Current history event    */
  1291. X***************
  1292. X*** 78,83 ****
  1293. X--- 107,113 ----
  1294. X  Var_List    *C_dir;        /* Current directory            */
  1295. X  char        *last_prompt;    /* Last prompt output            */
  1296. X  Var_List    *ifs;        /* Inter-field separator        */
  1297. X+ char        *Program_Name;    /* Program name                */
  1298. X  char        *home = "HOME";
  1299. X  char        *shell = "SHELL";
  1300. X  char        *history_file = "HISTFILE";
  1301. X***************
  1302. X*** 96,101 ****
  1303. X--- 126,132 ----
  1304. X      0,                /* File descriptor            */
  1305. X      AFID_NOBUF,            /* Buffer id                */
  1306. X      0L,                /* File position            */
  1307. X+     0,                /* Offset in buffer            */
  1308. X      (IO_Buf *)NULL        /* Buffer                */
  1309. X  };
  1310. X  
  1311. X***************
  1312. X*** 112,117 ****
  1313. X--- 143,161 ----
  1314. X      iostack,            /* I/O Stack pointers            */
  1315. X      iostack - 1,
  1316. X      (int *)NULL,
  1317. X+     FALSE,            /* End of file processing        */
  1318. X      FDBASE,            /* Base file handler            */
  1319. X      (Environ *)NULL        /* Previous Env pointer            */
  1320. X  };
  1321. X+ 
  1322. X+ /* The only bit of code in this module prints the version number */
  1323. X+ 
  1324. X+ void    Print_Version (fp)
  1325. X+ int    fp;
  1326. X+ {
  1327. X+     char    buf[100];
  1328. X+ 
  1329. X+     sprintf (buf, Copy_Right1, __DATE__, _osmajor, _osminor);
  1330. X+     write (fp, buf, strlen (buf));
  1331. X+     write (fp, Copy_Right2, strlen (Copy_Right2));
  1332. X+ }
  1333. XIndex: shell/sh0.asm
  1334. XPrereq: 1.2
  1335. X*** ../sh15/shell/sh0.asm    Fri Feb 16 19:13:56 1990
  1336. X--- shell/sh0.asm    Tue May  1 19:50:48 1990
  1337. X***************
  1338. X*** 4,11 ****
  1339. X  
  1340. X  ; MS-DOS SHELL - Swapper
  1341. X  ;
  1342. X- ; MS-DOS SHELL - Copyright (c) 1989 Data Logic Limited.
  1343. X- ;
  1344. X  ; MS-DOS SHELL - Copyright (c) 1990 Data Logic Limited
  1345. X  ;
  1346. X  ; This code is subject to the following copyright restrictions:
  1347. X--- 4,9 ----
  1348. X***************
  1349. X*** 18,26 ****
  1350. X  ; 2.  The sources (or parts thereof) or objects generated from the sources
  1351. X  ;     (or parts of sources) cannot be sold under any circumstances.
  1352. X  ;
  1353. X! ;    $Header: sh0.asm 1.2 90/02/14 04:45:58 MS_user Exp $
  1354. X  ;
  1355. X  ;    $Log:    sh0.asm $
  1356. X  ;    Revision 1.2  90/02/14  04:45:58  MS_user
  1357. X  ;    Add Interrupt 24 processing and clean up interrupt 0 and 23 processing
  1358. X  ;    
  1359. X--- 16,42 ----
  1360. X  ; 2.  The sources (or parts thereof) or objects generated from the sources
  1361. X  ;     (or parts of sources) cannot be sold under any circumstances.
  1362. X  ;
  1363. X! ;    $Header: sh0.asm 1.8 90/04/25 22:32:31 MS_user Exp $
  1364. X  ;
  1365. X  ;    $Log:    sh0.asm $
  1366. X+ ;    Revision 1.8  90/04/25  22:32:31  MS_user
  1367. X+ ;    Fix missing disk full check on writing swap file
  1368. X+ ;    
  1369. X+ ;    Revision 1.7  90/04/11  12:54:38  MS_user
  1370. X+ ;    Fix non-disk device name print in CEH
  1371. X+ ;    
  1372. X+ ;    Revision 1.6  90/03/26  04:31:01  MS_user
  1373. X+ ;    Remove original Interrupt 24 save address
  1374. X+ ;    
  1375. X+ ;    Revision 1.5  90/03/26  04:12:38  MS_user
  1376. X+ ;    Add Full Interrupt 24 handler
  1377. X+ ;    
  1378. X+ ;    Revision 1.4  90/03/05  13:47:05  MS_user
  1379. X+ ;    Add XMS driver
  1380. X+ ;    
  1381. X+ ;    Revision 1.3  90/02/22  16:50:23  MS_user
  1382. X+ ;    Add XMS Driver support
  1383. X+ ;    
  1384. X  ;    Revision 1.2  90/02/14  04:45:58  MS_user
  1385. X  ;    Add Interrupt 24 processing and clean up interrupt 0 and 23 processing
  1386. X  ;    
  1387. X***************
  1388. X*** 72,97 ****
  1389. X          public    _SW_fp
  1390. X          public    _SW_I0_V
  1391. X          public    _SW_I23_V
  1392. X-         public    _SW_I24_V 
  1393. X          public    _SW_EMstart
  1394. X          public    _SW_Mode
  1395. X          public    _SW_EMSFrame
  1396. X          public    _SW_Int24
  1397. X  
  1398. X  _cmd_line    db    129 dup (?)    ; Command line
  1399. X  _path_line    db    80 dup (?)    ; Path line
  1400. X  _SW_Blocks    dw    0        ; Number of blocks to read/write
  1401. X  _SW_fp        dw    0        ; File ID
  1402. X  _SW_I0_V    dd    0        ; Our Interrupt Zero address
  1403. X  _SW_I23_V    dd    0        ; Our Interrupt 23 address
  1404. X- _SW_I24_V     dd    0        ; Original Interrupt 24 address
  1405. X  _SW_EMstart    dd    0100000H    ; Default Extended Mem start
  1406. X  _SW_Mode    dw    0        ; Type of swapping to do
  1407. X                      ;   1 - disk
  1408. X                      ;   2 - Extended memory
  1409. X!                     ;   3 - Expanded memory
  1410. X  _SW_EMSFrame    dw    0        ; EMS Frame segment
  1411. X  _SW_intr    dw    0        ; Interrupt 23 detected.
  1412. SHAR_EOF
  1413. echo "End of part 1"
  1414. echo "File Patch1.6 is continued in part 2"
  1415. echo "2" > s2_seq_.tmp
  1416. exit 0
  1417.  
  1418.  
  1419.