home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / ARCH / PAX20-2 / PATCHES.OS2 < prev    next >
Text File  |  1993-12-24  |  33KB  |  1,277 lines

  1. Only in new: README.OS2
  2. Only in new: Makefile
  3. Only in new: pax.def
  4. Only in new: config.h
  5. Only in new: diskacc2.c
  6. Only in new: diskacc2.h
  7. Only in new: disktape.c
  8. Only in new: disktape.h
  9. diff -cb orig/append.c new/append.c
  10. *** orig/append.c    Mon Dec 18 10:24:14 1989
  11. --- new/append.c    Fri Dec 24 16:36:08 1993
  12. ***************
  13. *** 32,38 ****
  14.    * patch1: Added some additional support for MS-DOS
  15.    * 
  16.    * Revision 2.0.0.4  89/10/30  07:42:36  mark
  17. !  * Added <sys/mtio.h> for MSDOS
  18.    * 
  19.    * Revision 2.0.0.3  89/10/13  02:34:15  mark
  20.    * Beta Test Freeze
  21. --- 32,38 ----
  22.    * patch1: Added some additional support for MS-DOS
  23.    *
  24.    * Revision 2.0.0.4  89/10/30  07:42:36  mark
  25. !  * Added <sys/mtio.h> for MS-DOS
  26.    *
  27.    * Revision 2.0.0.3  89/10/13  02:34:15  mark
  28.    * Beta Test Freeze
  29. diff -cb orig/buffer.c new/buffer.c
  30. *** orig/buffer.c    Mon Dec 18 10:25:38 1989
  31. --- new/buffer.c    Sat Dec 30 15:48:42 1989
  32. ***************
  33. *** 673,679 ****
  34.           bufend += got;
  35.           } else if (got < 0) {
  36.           failed = -1;
  37. !         warnarch(strerror(), (OFFSET) 0 - (bufend - bufidx));
  38.           } else {
  39.           ++areof;
  40.           }
  41. --- 673,679 ----
  42.           bufend += got;
  43.           } else if (got < 0) {
  44.           failed = -1;
  45. !         warnarch(strerror(), (OFFSET) 0L - (OFFSET) (bufend - bufidx));
  46.           } else {
  47.           ++areof;
  48.           }
  49. diff -cb orig/cpio.c new/cpio.c
  50. *** orig/cpio.c    Mon Dec 18 10:29:26 1989
  51. --- new/cpio.c    Fri Dec 24 17:30:46 1993
  52. ***************
  53. *** 187,198 ****
  54.       }
  55.       }
  56.   
  57. ! #ifdef MSDOS
  58.       setmode(fileno(msgfile), O_TEXT);
  59.       if (names_from_stdin) {
  60.           setmode(fileno(stdin), O_TEXT);
  61.       }
  62. ! #endif /* MSDOS */
  63.   
  64.       if (f_create + f_pass + f_extract != 1) {
  65.       usage();
  66. --- 187,198 ----
  67.       }
  68.       }
  69.   
  70. ! #ifdef PC
  71.       setmode(fileno(msgfile), O_TEXT);
  72.       if (names_from_stdin) {
  73.           setmode(fileno(stdin), O_TEXT);
  74.       }
  75. ! #endif /* PC */
  76.   
  77.       if (f_create + f_pass + f_extract != 1) {
  78.       usage();
  79. ***************
  80. *** 244,251 ****
  81. --- 244,267 ----
  82.   #endif
  83.   {
  84.       DBUG_ENTER("usage");
  85. + #ifdef PC
  86. +     printf("\r\nPAX version 2.0 - POSIX conforming tar and cpio archiver\r\n");
  87. +     printf("\r\nUsage: %s -o[Bacv]\r\n", myname);
  88. +     printf("       %s -i[Bcdmrtuvf] [pattern...]\r\n", myname);
  89. +     printf("       %s -p[adlmruv] directory\r\n", myname);
  90. +     printf("\r\nUse the nonstandard option \"-D file\" for files as input/output archives."
  91. +            "\r\nRename CPIO.EXE to PAX.EXE or TAR.EXE to get the PAX or TAR user interface.\r\n");
  92. + #ifdef DISKACC
  93. +     printf("\r\nUse the option -D with drive letter arguments to access Unix floppy"
  94. +            "\r\ndisks with cpio archives. The disk type is automatically detected.\r\n");
  95. + #endif
  96. + #else
  97.       fprintf(stderr, "Usage: %s -o[Bacv]\n", myname);
  98.       fprintf(stderr, "       %s -i[Bcdmrtuvf] [pattern...]\n", myname);
  99.       fprintf(stderr, "       %s -p[adlmruv] directory\n", myname);
  100. + #endif
  101.       exit(1);
  102.   }
  103. diff -cb orig/fileio.c new/fileio.c
  104. *** orig/fileio.c    Mon Dec 18 10:27:52 1989
  105. --- new/fileio.c    Fri Dec 24 17:09:54 1993
  106. ***************
  107. *** 30,36 ****
  108.    *
  109.    * $Log:    fileio.c,v $
  110.    * Revision 2.0.0.4  89/10/30  07:51:34  mark
  111. !  * Added call to dio_to_binary to support real character devices under MSDOS.
  112.    * 
  113.    * Revision 2.0.0.3  89/10/13  02:34:59  mark
  114.    * Beta Test Freeze
  115. --- 30,36 ----
  116.    *
  117.    * $Log:    fileio.c,v $
  118.    * Revision 2.0.0.4  89/10/30  07:51:34  mark
  119. !  * Added call to dio_to_binary to support real character devices under MS-DOS.
  120.    *
  121.    * Revision 2.0.0.3  89/10/13  02:34:59  mark
  122.    * Beta Test Freeze
  123. ***************
  124. *** 89,95 ****
  125.           archivefd = STDOUT;
  126.       }
  127.       } else if (mode == AR_READ) {
  128. !     archivefd = OPEN2(ar_file, O_RDONLY | O_BINARY);
  129.       bufend = bufidx = bufstart;    /* set up for initial read */
  130.       } else if (mode == AR_WRITE) {
  131.       archivefd = OPEN3(ar_file, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY,
  132. --- 89,95 ----
  133.           archivefd = STDOUT;
  134.       }
  135.       } else if (mode == AR_READ) {
  136. !     archivefd = OPEN(ar_file, O_RDONLY | O_BINARY);
  137.       bufend = bufidx = bufstart;    /* set up for initial read */
  138.       } else if (mode == AR_WRITE) {
  139.       archivefd = OPEN3(ar_file, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY,
  140. ***************
  141. *** 99,110 ****
  142.       bufend = bufidx = bufstart;    /* set up for initial read */
  143.       }
  144.       
  145. ! #ifndef MSDOS    
  146. !     if (archivefd < 0) {
  147. !     warnarch(strerror(), (OFFSET) 0);
  148. !     DBUG_RETURN(-1);
  149. !     }
  150. ! #else /* MSDOS */
  151.       if (dio_open_check(ar_file) < 0) {
  152.       if (archivefd >= 0) {
  153.           warnarch(strerror(), (OFFSET) 0);
  154. --- 99,105 ----
  155.       bufend = bufidx = bufstart;    /* set up for initial read */
  156.       }
  157.   
  158. ! #if defined(PC) && defined(DIO)
  159.       if (dio_open_check(ar_file) < 0) {
  160.       if (archivefd >= 0) {
  161.           warnarch(strerror(), (OFFSET) 0);
  162. ***************
  163. *** 119,125 ****
  164.       if (dio_to_binary(archivefd) < 0) {
  165.           DBUG_RETURN(-1);
  166.       }
  167. ! #endif /* MSDOS */
  168.       
  169.       ++arvolume;
  170.       DBUG_RETURN(0);
  171. --- 114,125 ----
  172.       if (dio_to_binary(archivefd) < 0) {
  173.           DBUG_RETURN(-1);
  174.       }
  175. ! #else
  176. !     if (archivefd < 0) {
  177. !     warnarch(strerror(), (OFFSET) 0);
  178. !     DBUG_RETURN(-1);
  179. !     }
  180. ! #endif /* PC */
  181.   
  182.       ++arvolume;
  183.       DBUG_RETURN(0);
  184. ***************
  185. *** 256,261 ****
  186. --- 256,262 ----
  187.       perm = asb->sb_mode & S_IPERM;
  188.       switch (asb->sb_mode & S_IFMT) {
  189.   
  190. + #ifndef PC
  191.   #ifdef S_IFBLK
  192.       case S_IFBLK:
  193.   #endif /* S_IFBLK */
  194. ***************
  195. *** 296,301 ****
  196. --- 297,303 ----
  197.       DBUG_RETURN(0);
  198.       break;
  199.   #endif /* S_IFCHR */
  200. + #endif
  201.   
  202.       case S_IFDIR:
  203.       if (exists) {
  204. ***************
  205. *** 386,396 ****
  206.           exists = 0;
  207.           }
  208.       }
  209. !     if ((fd = creat(name, (int) perm)) < 0) {
  210.           if (errno == ENOENT) {
  211.           if (f_dir_create) {
  212.               if (dirneed(name) < 0 ||
  213. !             (fd = creat(name, (int) perm)) < 0) {
  214.               warn(name, strerror());
  215.               DBUG_RETURN(-1);
  216.               }
  217. --- 388,399 ----
  218.           exists = 0;
  219.           }
  220.       }
  221. !     if ((fd = open(name, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, (int) perm)) < 0) {
  222.           if (errno == ENOENT) {
  223.           if (f_dir_create) {
  224.               if (dirneed(name) < 0 ||
  225. !             (fd = open(name, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 
  226. !                    (int) perm)) < 0) {
  227.               warn(name, strerror());
  228.               DBUG_RETURN(-1);
  229.               }
  230. diff -cb orig/func.h new/func.h
  231. *** orig/func.h    Mon Dec 18 10:28:52 1989
  232. --- new/func.h    Fri Dec 24 17:06:40 1993
  233. ***************
  234. *** 79,91 ****
  235.   struct group   *getgrgid();
  236.   struct group   *getgrnam();
  237.   struct passwd  *getpwuid();
  238. ! char           *getenv(char *);
  239.   Link           *islink(char *, Stat *);
  240.   char           *finduname(UIDTYPE);
  241.   char           *findgname(GIDTYPE);
  242.   GIDTYPE     findgid(char *);
  243.   UIDTYPE     finduid(char *);
  244. ! char           *malloc();
  245.   char           *index(char *, char);
  246.   char           *rindex(char *, char);
  247.   
  248. --- 79,91 ----
  249.   struct group   *getgrgid();
  250.   struct group   *getgrnam();
  251.   struct passwd  *getpwuid();
  252. ! char           *getenv(const char *);
  253.   Link           *islink(char *, Stat *);
  254.   char           *finduname(UIDTYPE);
  255.   char           *findgname(GIDTYPE);
  256.   GIDTYPE     findgid(char *);
  257.   UIDTYPE     finduid(char *);
  258. ! void           *malloc();
  259.   char           *index(char *, char);
  260.   char           *rindex(char *, char);
  261.   
  262. ***************
  263. *** 99,105 ****
  264.   int                 (*signal()) ();
  265.   #endif /* VOIDSIG */
  266.   
  267. ! #ifdef MSDOS 
  268.   extern  int dio_write(int drive,char *from_buf,unsigned int from_cnt);
  269.   extern  int dio_read(int drive,char *to_buf,unsigned int to_cnt);
  270.   extern  int dio_open_check(char *s);
  271. --- 99,105 ----
  272.   int                 (*signal()) ();
  273.   #endif /* VOIDSIG */
  274.   
  275. ! #if defined(PC) && defined(DIO)
  276.   extern  int dio_write(int drive,char *from_buf,unsigned int from_cnt);
  277.   extern  int dio_read(int drive,char *to_buf,unsigned int to_cnt);
  278.   extern  int dio_open_check(char *s);
  279. ***************
  280. *** 108,114 ****
  281.   extern  int dio_close(int h);
  282.   extern  long dio_lseek(int h,long o,int r);
  283.   extern    void dio_str(char *s);
  284. ! #endif /* MSDOS */
  285.   
  286.   #else /* !__STDC__ */
  287.   
  288. --- 108,114 ----
  289.   extern  int dio_close(int h);
  290.   extern  long dio_lseek(int h,long o,int r);
  291.   extern    void dio_str(char *s);
  292. ! #endif /* PC */
  293.   
  294.   #else /* !__STDC__ */
  295.   
  296. ***************
  297. *** 181,187 ****
  298.   extern int          (*signal()) ();
  299.   #endif
  300.   
  301. ! #ifdef MSDOS
  302.   extern  int dio_write();
  303.   extern  int dio_read();
  304.   extern  int dio_open_check();
  305. --- 181,187 ----
  306.   extern int          (*signal()) ();
  307.   #endif
  308.   
  309. ! #if defined(PC) && defined(DIO)
  310.   extern  int dio_write();
  311.   extern  int dio_read();
  312.   extern  int dio_open_check();
  313. ***************
  314. *** 190,202 ****
  315.   extern  int dio_close();
  316.   extern  long dio_lseek();
  317.   extern    void dio_str();
  318. ! #endif /* MSDOS */
  319.   
  320. ! #ifndef /* STRTOK */
  321.   extern    char *strtok();
  322.   #endif /* STRTOK */
  323.   
  324.   #endif /* __STDC__ */
  325.   #endif /* _PAX_FUNC_H */
  326. --- 190,200 ----
  327.   extern  int dio_close();
  328.   extern  long dio_lseek();
  329.   extern    void dio_str();
  330. ! #endif /* PC */
  331.   
  332. ! #ifndef STRTOK
  333.   extern    char *strtok();
  334.   #endif /* STRTOK */
  335.   
  336.   #endif /* __STDC__ */
  337.   #endif /* _PAX_FUNC_H */
  338. diff -cb orig/limits.h new/limits.h
  339. *** orig/limits.h    Mon Dec 18 10:30:06 1989
  340. --- new/limits.h    Sun Oct 28 17:20:52 1990
  341. ***************
  342. *** 51,57 ****
  343.   
  344.   #ifndef NAME_MAX
  345.   /* This should be 32 for BSD systems */
  346. ! #define NAME_MAX    14    /* Max number of bytes in a filename */
  347.   #endif /* NAME_MAX */
  348.   
  349.   #endif /* _PAX_LIMITS_H */
  350. --- 51,57 ----
  351.   
  352.   #ifndef NAME_MAX
  353.   /* This should be 32 for BSD systems */
  354. ! #define NAME_MAX    255    /* Max number of bytes in a filename */
  355.   #endif /* NAME_MAX */
  356.   
  357.   #endif /* _PAX_LIMITS_H */
  358. diff -cb orig/list.c new/list.c
  359. *** orig/list.c    Mon Dec 18 10:26:28 1989
  360. --- new/list.c    Fri Dec 24 16:24:48 1993
  361. ***************
  362. *** 398,404 ****
  363.       struct tm          *atm;
  364.       int            i;
  365.       Link               *link;
  366. !     int                 mode;
  367.   #ifdef S_IFLNK
  368.       char                symnam[PATH_MAX];
  369.   #endif
  370. --- 398,404 ----
  371.       struct tm          *atm;
  372.       int            i;
  373.       Link               *link;
  374. !     unsigned            mode;
  375.   #ifdef S_IFLNK
  376.       char                symnam[PATH_MAX];
  377.   #endif
  378. ***************
  379. *** 462,468 ****
  380.       if (f_verbose) {
  381.           atm = localtime(&asb->sb_mtime);
  382.           pr_mode(asb->sb_mode);
  383. !         fprintf(msgfile, " %d/%d %6ld %3s %2d %02d:%02d %4d %s",
  384.               asb->sb_uid, asb->sb_gid, asb->sb_size,
  385.               monnames[atm->tm_mon], atm->tm_mday, atm->tm_hour,
  386.               atm->tm_min, atm->tm_year + 1900, name);
  387. --- 462,468 ----
  388.       if (f_verbose) {
  389.           atm = localtime(&asb->sb_mtime);
  390.           pr_mode(asb->sb_mode);
  391. !             fprintf(msgfile, " %3d/%-3d %6ld %3s %2d %02d:%02d %4d %s",
  392.               asb->sb_uid, asb->sb_gid, asb->sb_size,
  393.               monnames[atm->tm_mon], atm->tm_mday, atm->tm_hour,
  394.               atm->tm_min, atm->tm_year + 1900, name);
  395. ***************
  396. *** 538,543 ****
  397. --- 538,544 ----
  398.       pr_mode(asb->sb_mode);
  399.       fprintf(msgfile, " %3d", asb->sb_nlink);
  400.           atm = localtime(&asb->sb_mtime);
  401. + #ifndef PC
  402.       if (pwp = getpwuid((UIDTYPE) USH(asb->sb_uid))) {
  403.           fprintf(msgfile, " %-8s", pwp->pw_name);
  404.       } else {
  405. ***************
  406. *** 548,553 ****
  407. --- 549,555 ----
  408.       } else {
  409.           fprintf(msgfile, " %-8u", USH(asb->sb_gid));
  410.           }
  411. + #endif
  412.       switch (asb->sb_mode & S_IFMT) {
  413.   
  414.   #ifdef S_IFBLK
  415. diff -cb orig/msdos.c new/msdos.c
  416. *** orig/msdos.c    Mon Dec 18 10:26:40 1989
  417. --- new/msdos.c    Fri Dec 24 16:36:34 1993
  418. ***************
  419. *** 10,19 ****
  420.    *    under MS-DOS.
  421.    *
  422.    *    NOTE: Before these routines can be used to read/write directly to
  423. !  *    the disk, bypassing the logical file structure, MSDOS MUST know
  424.    *    what kind of disk is in the drive you intend to write to.  This can
  425.    *    be accomplished by putting a formatted disk in the drive of
  426. !  *    interest and doing a DIR on it.  MSDOS then remembers the disk type
  427.    *    for a while.
  428.    *
  429.    *    WARNING: DISABLING THE BUILT IN CHECK AND CALLING THESE ROUTINES
  430. --- 10,19 ----
  431.    *    under MS-DOS.
  432.    *
  433.    *    NOTE: Before these routines can be used to read/write directly to
  434. !  *    the disk, bypassing the logical file structure, MS-DOS MUST know
  435.    *    what kind of disk is in the drive you intend to write to.  This can
  436.    *    be accomplished by putting a formatted disk in the drive of
  437. !  *    interest and doing a DIR on it.  MS-DOS then remembers the disk type
  438.    *    for a while.
  439.    *
  440.    *    WARNING: DISABLING THE BUILT IN CHECK AND CALLING THESE ROUTINES
  441. ***************
  442. *** 57,72 ****
  443.   /* Headers */
  444.   
  445.   #include "pax.h"
  446. ! #ifdef MSDOS
  447.   #include <sys/types.h>
  448.   #include <stdio.h>
  449.   #include <stdlib.h>
  450.   #include <ctype.h>
  451. - #include <string.h>
  452.   #include <errno.h>
  453.   #include <dos.h>
  454.   
  455.   
  456.   /* Function Prototypes */
  457.   
  458.   #ifdef __STDC__
  459. --- 57,74 ----
  460.   /* Headers */
  461.   
  462.   #include "pax.h"
  463. ! #ifdef PC
  464.   #include <sys/types.h>
  465.   #include <stdio.h>
  466.   #include <stdlib.h>
  467.   #include <ctype.h>
  468.   #include <errno.h>
  469.   #include <dos.h>
  470.   
  471.   
  472. + #ifdef DIO
  473.   /* Function Prototypes */
  474.   
  475.   #ifdef __STDC__
  476. ***************
  477. *** 108,114 ****
  478.   static union REGS   reg;
  479.   static union REGS   rreg;
  480.   
  481. ! #ifdef M_I86LM
  482.   static struct SREGS sreg;
  483.   #endif /* !M_I86LM */
  484.   
  485. --- 110,116 ----
  486.   static union REGS   reg;
  487.   static union REGS   rreg;
  488.   
  489. ! #if defined(M_I86LM) || defined(M_I86CM)
  490.   static struct SREGS sreg;
  491.   #endif /* !M_I86LM */
  492.   
  493. ***************
  494. *** 142,148 ****
  495.       reg.x.ax = drive;
  496.       reg.x.dx = secnum;
  497.       reg.x.cx = secknt;
  498. ! #ifdef M_I86LM
  499.       reg.x.bx = FP_OFF(buf);
  500.       sreg.ds = FP_SEG(buf);
  501.       int86x(0x26, ®, &rreg, &sreg);
  502. --- 144,150 ----
  503.       reg.x.ax = drive;
  504.       reg.x.dx = secnum;
  505.       reg.x.cx = secknt;
  506. ! #if defined(M_I86LM) || defined(M_I86CM)
  507.       reg.x.bx = FP_OFF(buf);
  508.       sreg.ds = FP_SEG(buf);
  509.       int86x(0x26, ®, &rreg, &sreg);
  510. ***************
  511. *** 165,178 ****
  512.       unsigned int        secnum;
  513.       unsigned int        secknt;
  514.       unsigned int       *err;
  515. !     unsigned int       *buf;
  516.   {
  517.       DBUG_ENTER("dio_adr");
  518.       rwsec = secnum;
  519.       reg.x.ax = drive;
  520.       reg.x.dx = secnum;
  521.       reg.x.cx = secknt;
  522. ! #ifdef M_I86LM
  523.       reg.x.bx = FP_OFF(buf);
  524.       sreg.ds = FP_SEG(buf);
  525.       int86x(0x25, ®, &rreg, &sreg);
  526. --- 167,180 ----
  527.       unsigned int        secnum;
  528.       unsigned int        secknt;
  529.       unsigned int       *err;
  530. !     char               *buf;
  531.   {
  532.       DBUG_ENTER("dio_adr");
  533.       rwsec = secnum;
  534.       reg.x.ax = drive;
  535.       reg.x.dx = secnum;
  536.       reg.x.cx = secknt;
  537. ! #if defined(M_I86LM) || defined(M_I86CM)
  538.       reg.x.bx = FP_OFF(buf);
  539.       sreg.ds = FP_SEG(buf);
  540.       int86x(0x25, ®, &rreg, &sreg);
  541. ***************
  542. *** 344,350 ****
  543.                        * written */
  544.       unsigned int        from_cnt;    /* number of bytes to write */
  545.   {
  546. !     unsigned int        amt:
  547.       unsigned int        err;
  548.       unsigned int        nn;
  549.       unsigned int        fquo;
  550. --- 346,352 ----
  551.                        * written */
  552.       unsigned int        from_cnt;    /* number of bytes to write */
  553.   {
  554. !     unsigned int        amt;
  555.       unsigned int        err;
  556.       unsigned int        nn;
  557.       unsigned int        fquo;
  558. ***************
  559. *** 637,642 ****
  560. --- 639,645 ----
  561.       DBUG_RETURN (fptr);
  562.   }
  563.   
  564. + #endif
  565.   
  566.   static struct passwd npwd = {"", "", 0, 0, 0, "", "", "", ""};
  567.   static char gmem1[] = "";
  568. ***************
  569. *** 714,717 ****
  570.       return(0);
  571.   }
  572.   
  573. ! #endif /* MSDOS */
  574. --- 717,720 ----
  575.       return(0);
  576.   }
  577.   
  578. ! #endif /* PC */
  579. diff -cb orig/namelist.c new/namelist.c
  580. *** orig/namelist.c    Mon Dec 18 10:27:38 1989
  581. --- new/namelist.c    Fri Dec 24 16:23:34 1993
  582. ***************
  583. *** 126,134 ****
  584.   
  585.       DBUG_ENTER("add_name");
  586.       
  587. ! #ifdef MSDOS
  588.       dio_str(name);
  589. ! #endif /* MSDOS */
  590.       
  591.       i = strlen(name);
  592.       p = (struct nm_list *) malloc((unsigned) (i + sizeof(struct nm_list)));
  593. --- 126,134 ----
  594.   
  595.       DBUG_ENTER("add_name");
  596.   
  597. ! #if defined(PC) && defined(DIO)
  598.       dio_str(name);
  599. ! #endif /* PC */
  600.   
  601.       i = strlen(name);
  602.       p = (struct nm_list *) malloc((unsigned) (i + sizeof(struct nm_list)));
  603. ***************
  604. *** 432,440 ****
  605.       }
  606.       } while (err < 0);
  607.       
  608. ! #ifdef MSDOS
  609.       dio_str(name);
  610. ! #endif /* MSDOS */
  611.       
  612.       DBUG_RETURN(0);
  613.   }
  614. --- 432,440 ----
  615.       }
  616.       } while (err < 0);
  617.   
  618. ! #if defined(PC) && defined(DIO)
  619.       dio_str(name);
  620. ! #endif /* PC */
  621.   
  622.       DBUG_RETURN(0);
  623.   }
  624. diff -cb orig/names.c new/names.c
  625. *** orig/names.c    Mon Dec 18 10:29:10 1989
  626. --- new/names.c    Fri Dec 24 16:23:02 1993
  627. ***************
  628. *** 53,59 ****
  629.   
  630.   /* Internal Identifiers */
  631.   
  632. ! #ifndef MSDOS
  633.   static UIDTYPE      saveuid = -993;
  634.   static char         saveuname[TUNMLEN];
  635.   static UIDTYPE      my_uid = -993;
  636. --- 53,59 ----
  637.   
  638.   /* Internal Identifiers */
  639.   
  640. ! #ifndef PC
  641.   static UIDTYPE      saveuid = -993;
  642.   static char         saveuname[TUNMLEN];
  643.   static UIDTYPE      my_uid = -993;
  644. ***************
  645. *** 61,67 ****
  646.   static GIDTYPE      savegid = -993;
  647.   static char         savegname[TGNMLEN];
  648.   static GIDTYPE      my_gid = -993;
  649. ! #else /* MSDOS */
  650.   static int      saveuid = 0;
  651.   static char     saveuname[TUNMLEN] = "";
  652.   static int      my_uid = 0;
  653. --- 61,67 ----
  654.   static GIDTYPE      savegid = -993;
  655.   static char         savegname[TGNMLEN];
  656.   static GIDTYPE      my_gid = -993;
  657. ! #else /* PC */
  658.   static int      saveuid = 0;
  659.   static char     saveuname[TUNMLEN] = "";
  660.   static int      my_uid = 0;
  661. ***************
  662. *** 69,75 ****
  663.   static int      savegid = 0;
  664.   static char     savegname[TGNMLEN] = "";
  665.   static int      my_gid = 0;
  666. ! #endif /* MSDOS */
  667.   
  668.   /* finduname - find a user or group name from a uid or gid
  669.    *
  670. --- 69,75 ----
  671.   static int      savegid = 0;
  672.   static char     savegname[TGNMLEN] = "";
  673.   static int      my_gid = 0;
  674. ! #endif /* PC */
  675.   
  676.   /* finduname - find a user or group name from a uid or gid
  677.    *
  678. diff -cb orig/pass.c new/pass.c
  679. *** orig/pass.c    Mon Dec 18 10:27:40 1989
  680. --- new/pass.c    Sat Dec 30 16:09:30 1989
  681. ***************
  682. *** 141,147 ****
  683.       char                to[PATH_MAX + 1];
  684.   
  685.       DBUG_ENTER("passitem");
  686. !     if (nameopt(strcat(strcat(strcpy(to, dir), "/"), from)) < 0) {
  687.       DBUG_RETURN(-1);
  688.       }
  689.       if (asb->sb_nlink > 1) {
  690. --- 141,151 ----
  691.       char                to[PATH_MAX + 1];
  692.   
  693.       DBUG_ENTER("passitem");
  694. !     strcpy(to, dir);
  695. !     strcat(to, "/");
  696. !     strcat(to, from);
  697. !     if (nameopt(to) < 0) {
  698.       DBUG_RETURN(-1);
  699.       }
  700.       if (asb->sb_nlink > 1) {
  701. diff -cb orig/pax.c new/pax.c
  702. *** orig/pax.c    Mon Dec 18 10:27:14 1989
  703. --- new/pax.c    Fri Dec 24 17:31:28 1993
  704. ***************
  705. *** 160,179 ****
  706.   
  707.   #endif
  708.   {
  709. ! #ifdef MSDOS
  710.       char            *tmp;
  711. !     extern int         _fmode;
  712. ! #endif /* MSDOS */    
  713.       
  714.       DBUG_ENTER("main");
  715.       DBUG_PROCESS(argv[0]);
  716.       
  717. ! #ifdef MSDOS
  718. !     _fmode = O_BINARY;
  719.       setmode(fileno(stdin), O_BINARY);
  720.       setmode(fileno(stdout), O_BINARY);
  721.       /* strip the pathname off of the name of the executable */
  722.       dio_str(argv[0]);
  723.       if ((myname = strrchr(argv[0], '/')) != (char *)NULL) {
  724.        myname++;
  725.       } else if ((myname = strrchr(argv[0], '\\')) != (char *)NULL) {
  726. --- 160,184 ----
  727.   
  728.   #endif
  729.   {
  730. ! #ifdef PC
  731.       char            *tmp;
  732. ! #endif /* PC */
  733. ! #ifdef __EMX__
  734. !     _response(&argc, &argv);
  735. !     _wildcard(&argc, &argv);
  736. ! #endif
  737.   
  738.       DBUG_ENTER("main");
  739.       DBUG_PROCESS(argv[0]);
  740.   
  741. ! #ifdef PC
  742.       setmode(fileno(stdin), O_BINARY);
  743.       setmode(fileno(stdout), O_BINARY);
  744.       /* strip the pathname off of the name of the executable */
  745. + #ifdef DIO
  746.       dio_str(argv[0]);
  747. + #endif
  748.       if ((myname = strrchr(argv[0], '/')) != (char *)NULL) {
  749.        myname++;
  750.       } else if ((myname = strrchr(argv[0], '\\')) != (char *)NULL) {
  751. ***************
  752. *** 181,197 ****
  753.       } else {
  754.       myname = argv[0];
  755.       }
  756. !     if ((tmp = strrchr(myname, '.')) != (char *) NULL)
  757.       *tmp = '\0';
  758.       }
  759. ! #else /* !MSDOS */
  760.       /* strip the pathname off of the name of the executable */
  761.       if ((myname = rindex(argv[0], '/')) != (char *) NULL) {
  762.       myname++;
  763.       } else {
  764.       myname = argv[0];
  765.       }
  766. ! #endif /* MSDOS */    
  767.   
  768.       /* set up for collecting other command line arguments */
  769.       name_init(argc, argv);
  770. --- 186,202 ----
  771.       } else {
  772.       myname = argv[0];
  773.       }
  774. !     if ((tmp = strrchr(myname, '.')) != (char *) NULL) {
  775.       *tmp = '\0';
  776.       }
  777. ! #else /* !PC */
  778.       /* strip the pathname off of the name of the executable */
  779.       if ((myname = rindex(argv[0], '/')) != (char *) NULL) {
  780.       myname++;
  781.       } else {
  782.       myname = argv[0];
  783.       }
  784. ! #endif /* PC */
  785.   
  786.       /* set up for collecting other command line arguments */
  787.       name_init(argc, argv);
  788. ***************
  789. *** 205,214 ****
  790.       /* open terminal for interactive queries */
  791.       ttyf = open_tty();
  792.   
  793. !     if (strcmp(myname, "tar") == 0) {
  794.       tar_interface = 1;
  795.       do_tar(argc, argv);
  796. !     } else if (strcmp(myname, "cpio") == 0) {
  797.       cpio_interface = 1;
  798.       do_cpio(argc, argv);
  799.       } else {
  800. --- 210,219 ----
  801.       /* open terminal for interactive queries */
  802.       ttyf = open_tty();
  803.   
  804. !     if (stricmp(myname, "tar") == 0) {
  805.       tar_interface = 1;
  806.       do_tar(argc, argv);
  807. !     } else if (stricmp(myname, "cpio") == 0) {
  808.       cpio_interface = 1;
  809.       do_cpio(argc, argv);
  810.       } else {
  811. ***************
  812. *** 375,383 ****
  813.           break;
  814.   
  815.       case 'x':
  816. !         if (strcmp(optarg, "ustar") == 0) {
  817.           ar_format = TAR;
  818. !         } else if (strcmp(optarg, "cpio") == 0) {
  819.           ar_format = CPIO;
  820.           } else {
  821.           usage();
  822. --- 380,388 ----
  823.           break;
  824.   
  825.       case 'x':
  826. !             if (stricmp(optarg, "ustar") == 0) {
  827.           ar_format = TAR;
  828. !             } else if (stricmp(optarg, "cpio") == 0) {
  829.           ar_format = CPIO;
  830.           } else {
  831.           usage();
  832. ***************
  833. *** 393,401 ****
  834.       }
  835.       }
  836.   
  837. ! #ifdef MSDOS
  838.       setmode(fileno(msgfile), O_TEXT);
  839. ! #endif /* MSDOS */
  840.   
  841.       if (blocksize == 0) {
  842.       blocking = 1;
  843. --- 398,411 ----
  844.       }
  845.       }
  846.   
  847. !     if ( strcmp(ar_file, "-") == 0
  848. !          && isatty(fileno(stdin))
  849. !          && isatty(fileno(stdout)) )
  850. !       usage();
  851. ! #ifdef PC
  852.       setmode(fileno(msgfile), O_TEXT);
  853. ! #endif /* PC */
  854.   
  855.       if (blocksize == 0) {
  856.       blocking = 1;
  857. ***************
  858. *** 412,422 ****
  859.           names_from_stdin++;    /* args from stdin */
  860.       }
  861.       
  862. ! #ifdef MSDOS
  863.           if (names_from_stdin) {
  864.               setmode(fileno(stdin), O_TEXT);
  865.       }
  866. ! #endif /* MSDOS */
  867.       
  868.       open_archive(AR_WRITE);
  869.       create_archive();
  870. --- 422,432 ----
  871.           names_from_stdin++;    /* args from stdin */
  872.       }
  873.   
  874. ! #ifdef PC
  875.           if (names_from_stdin) {
  876.               setmode(fileno(stdin), O_TEXT);
  877.       }
  878. ! #endif /* PC */
  879.   
  880.       open_archive(AR_WRITE);
  881.       create_archive();
  882. ***************
  883. *** 436,446 ****
  884.           names_from_stdin++;    /* args from stdin */
  885.       }
  886.   
  887. ! #ifdef MSDOS
  888.           if (names_from_stdin) {
  889.               setmode(fileno(stdin), O_TEXT);
  890.       }
  891. ! #endif /* MSDOS */
  892.       
  893.       pass(dirname);
  894.       } else {
  895. --- 446,456 ----
  896.           names_from_stdin++;    /* args from stdin */
  897.       }
  898.   
  899. ! #ifdef PC
  900.           if (names_from_stdin) {
  901.               setmode(fileno(stdin), O_TEXT);
  902.       }
  903. ! #endif /* PC */
  904.   
  905.       pass(dirname);
  906.       } else {
  907. ***************
  908. *** 622,634 ****
  909.   #endif
  910.   {
  911.       DBUG_ENTER("usage");
  912.       fprintf(stderr, "Usage: %s -[cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n",
  913.           myname);
  914.       fprintf(stderr, "       %s -r [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n",
  915.           myname);
  916. !     fprintf(stderr, "       %s -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]\n              [-t device] [-x format] [pathname...]\n",
  917.           myname);
  918.       fprintf(stderr, "       %s -r -w [-ilmopuvy] [-s replstr] [pathname...] directory\n",
  919.           myname);
  920.       exit(1);
  921.   }
  922. --- 632,662 ----
  923.   #endif
  924.   {
  925.       DBUG_ENTER("usage");
  926. + #ifdef PC
  927. +     printf("\r\nPAX version 2.0 - POSIX conforming tar and cpio archiver\r\n");
  928. +     printf("\r\nUsage: %s -[cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\r\n", myname);
  929. +     printf("       %s -r [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\r\n", myname);
  930. +     printf("       %s -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]\r\n"
  931. +            "              [-t device] [-x format] [pathname...]\r\n", myname);
  932. +     printf("       %s -r -w [-ilmopuvy] [-s replstr] [pathname...] directory\r\n", myname);
  933. +     printf("\r\nRename PAX.EXE to TAR.EXE or CPIO.EXE to get the TAR or CPIO user interface.\r\n");
  934. + #ifdef DISKACC
  935. +     printf("\r\nUse the option -t with drive letter arguments to access Unix floppy"
  936. +            "\r\ndisks with tar or cpio archives. The disk type is automatically detected.\r\n");
  937. + #endif
  938. + #else
  939.       fprintf(stderr, "Usage: %s -[cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n",
  940.           myname);
  941.       fprintf(stderr, "       %s -r [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern...]\n",
  942.           myname);
  943. !     fprintf(stderr, "       %s -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]\n"
  944. !                     "              [-t device] [-x format] [pathname...]\n",
  945.           myname);
  946.       fprintf(stderr, "       %s -r -w [-ilmopuvy] [-s replstr] [pathname...] directory\n",
  947.               myname);
  948. + #endif
  949.       exit(1);
  950.   }
  951. diff -cb orig/pax.h new/pax.h
  952. *** orig/pax.h    Mon Dec 18 10:27:58 1989
  953. --- new/pax.h    Fri Dec 24 16:35:44 1993
  954. ***************
  955. *** 43,58 ****
  956.   #include <sys/stat.h>
  957.   #include "regexp.h"
  958.   #include "dbug.h"
  959.   #ifdef __STDC_
  960.   #  include <string.h>
  961.   #  include <strlib.h>
  962.   #endif /* __STDC__ */
  963. ! #ifdef MSDOS
  964.   #  include <sys/ioctl.h>
  965. ! #endif /* MSDOS */
  966.   
  967.   #define DEF_TAR_FILE    "/dev/rmt0"
  968.   #define TTY            "/dev/tty"
  969.   
  970.   #ifdef IOCTL
  971.   #  include <sys/ioctl.h>
  972. --- 43,65 ----
  973.   #include <sys/stat.h>
  974.   #include "regexp.h"
  975.   #include "dbug.h"
  976.   #ifdef __STDC_
  977.   #  include <string.h>
  978.   #  include <strlib.h>
  979.   #endif /* __STDC__ */
  980. ! /* #ifdef PC
  981.   #  include <sys/ioctl.h>
  982. ! #endif /* PC */
  983.   
  984. + #ifdef PC
  985. + #define DEF_TAR_FILE    "archive.pax"
  986. + #define TTY        "con"
  987. + #else
  988.   #define DEF_TAR_FILE    "/dev/rmt0"
  989.   #define TTY            "/dev/tty"
  990. + #endif
  991.   
  992.   #ifdef IOCTL
  993.   #  include <sys/ioctl.h>
  994. ***************
  995. *** 72,84 ****
  996.   #  include <sys/inode.h>
  997.   #endif /* XENIX */
  998.   
  999. ! #ifndef MSDOS
  1000.   #  include <pwd.h>
  1001.   #  include <grp.h>
  1002. ! #endif /* MSDOS */
  1003.   
  1004.   #ifndef XENIX_286
  1005.   #  include <sys/file.h>
  1006.   #endif /* XENIX_286 */
  1007.   
  1008.   /* Defines */
  1009. --- 79,93 ----
  1010.   #  include <sys/inode.h>
  1011.   #endif /* XENIX */
  1012.   
  1013. ! #ifndef PC
  1014.   #  include <pwd.h>
  1015.   #  include <grp.h>
  1016. ! #endif /* PC */
  1017.   
  1018.   #ifndef XENIX_286
  1019. + #ifndef PC
  1020.   #  include <sys/file.h>
  1021. + #endif
  1022.   #endif /* XENIX_286 */
  1023.   
  1024.   /* Defines */
  1025. ***************
  1026. *** 347,354 ****
  1027. --- 356,368 ----
  1028.   
  1029.   extern char        *optarg;
  1030.   extern int          optind;
  1031. + #ifdef PC
  1032. + #include <stdlib.h>
  1033. + #else
  1034.   extern int          sys_nerr;
  1035.   extern char        *sys_errlist[];
  1036.   extern int          errno;
  1037. + #endif
  1038.   
  1039.   #endif /* _PAX_H */
  1040. Only in orig: pax.tar
  1041. diff -cb orig/port.h new/port.h
  1042. *** orig/port.h    Mon Dec 18 10:30:02 1989
  1043. --- new/port.h    Fri Dec 24 17:06:56 1993
  1044. ***************
  1045. *** 47,53 ****
  1046.   #define    TERM_SIGNAL(status)    ((status) & 0x7F)
  1047.   #define TERM_VALUE(status)    ((status) >> 8)
  1048.   
  1049. ! #ifdef MSDOS
  1050.   
  1051.   #include <io.h>
  1052.   #define    major(x)    (0)
  1053. --- 47,53 ----
  1054.   #define    TERM_SIGNAL(status)    ((status) & 0x7F)
  1055.   #define TERM_VALUE(status)    ((status) >> 8)
  1056.   
  1057. ! #ifdef PC
  1058.   
  1059.   #include <io.h>
  1060.   #define    major(x)    (0)
  1061. ***************
  1062. *** 73,82 ****
  1063.       char          **gr_mem;
  1064.   };
  1065.   
  1066. ! #endif /* MSDOS */
  1067.   
  1068.   
  1069. ! #ifdef MSDOS
  1070.   
  1071.   #define OPEN2(p,f) \
  1072.       ( (dio_open_check(p) < 0) ? dio_open2(p,f) : open(p,f) )
  1073. --- 73,84 ----
  1074.       char          **gr_mem;
  1075.   };
  1076.   
  1077. ! #endif /* PC */
  1078.   
  1079.   
  1080. ! #ifdef PC
  1081. ! #if defined(DIO)
  1082.   
  1083.   #define OPEN2(p,f) \
  1084.       ( (dio_open_check(p) < 0) ? dio_open2(p,f) : open(p,f) )
  1085. ***************
  1086. *** 91,97 ****
  1087.   #define LSEEK(h,o,r) \
  1088.       ( (h < 0) ? dio_lseek(h,o,r) : lseek(h,o,r) )
  1089.   
  1090. ! #else /* !MSDOS */
  1091.   
  1092.   #define OPEN2(p,f) open(p,f)
  1093.   #define OPEN3(p,f,m) open(p,f,m)
  1094. --- 93,105 ----
  1095.   #define LSEEK(h,o,r) \
  1096.       ( (h < 0) ? dio_lseek(h,o,r) : lseek(h,o,r) )
  1097.   
  1098. ! #elif defined(DISKACC)
  1099. ! #if defined(PC) && defined(DISKACC)
  1100. ! #include "disktape.h"
  1101. ! #endif /* PC */
  1102. ! #else
  1103.   
  1104.   #define OPEN2(p,f) open(p,f)
  1105.   #define OPEN3(p,f,m) open(p,f,m)
  1106. ***************
  1107. *** 100,104 ****
  1108.   #define WRITE(h,b,c) write(h,b,c)
  1109.   #define LSEEK(h,o,r) lseek(h,o,r)
  1110.   
  1111. ! #endif /* MSDOS */
  1112.   #endif /* _PAX_PORT_H */
  1113. --- 108,116 ----
  1114.   #define WRITE(h,b,c) write(h,b,c)
  1115.   #define LSEEK(h,o,r) lseek(h,o,r)
  1116.   
  1117. ! #endif
  1118. ! #endif /* PC */
  1119.   #endif /* _PAX_PORT_H */
  1120. diff -cb orig/tar.c new/tar.c
  1121. *** orig/tar.c    Mon Dec 18 10:26:02 1989
  1122. --- new/tar.c    Fri Dec 24 17:31:00 1993
  1123. ***************
  1124. *** 186,203 ****
  1125.       }
  1126.       }
  1127.   
  1128. ! #ifdef MSDOS
  1129.       setmode(fileno(msgfile), O_TEXT);
  1130.       if (names_from_stdin) {
  1131.           setmode(fileno(stdin), O_TEXT);
  1132.       }
  1133. ! #endif /* MSDOS */
  1134.   
  1135.       /* check command line argument sanity */
  1136.       if (f_create + f_extract + f_list + f_append + f_newer != 1) {
  1137.       (void) fprintf(stderr,
  1138.       "%s: you must specify exactly one of the c, t, r, u or x options\n",
  1139.                  myname);
  1140.       usage();
  1141.       exit(EX_ARGSBAD);
  1142.       }
  1143. --- 186,209 ----
  1144.       }
  1145.       }
  1146.   
  1147. ! #ifdef PC
  1148.       setmode(fileno(msgfile), O_TEXT);
  1149.       if (names_from_stdin) {
  1150.           setmode(fileno(stdin), O_TEXT);
  1151.       }
  1152. ! #endif /* PC */
  1153.   
  1154.       /* check command line argument sanity */
  1155.       if (f_create + f_extract + f_list + f_append + f_newer != 1) {
  1156. + #ifdef PC
  1157. +         printf(
  1158. +         "\r\n%s: you must specify exactly one of the c, t, r, u or x options\r\n",
  1159. +                        myname);
  1160. + #else
  1161.       (void) fprintf(stderr,
  1162.       "%s: you must specify exactly one of the c, t, r, u or x options\n",
  1163.                          myname);
  1164. + #endif
  1165.       usage();
  1166.       exit(EX_ARGSBAD);
  1167.       }
  1168. ***************
  1169. *** 347,356 ****
  1170. --- 353,379 ----
  1171.   #endif
  1172.   {
  1173.       DBUG_ENTER("usage");
  1174. + #ifdef PC
  1175. +     printf("\r\nPAX version 2.0 - POSIX conforming tar and cpio archiver\r\n");
  1176. +     printf("\r\nUsage: %s -c[bfvw] device block filename..\r\n", myname);
  1177. +     printf("       %s -r[bvw] device block [filename...]\r\n", myname);
  1178. +     printf("       %s -t[vf] device\r\n", myname);
  1179. +     printf("       %s -u[bvw] device block [filename...]\r\n", myname);
  1180. +     printf("       %s -x[flmovw] device [filename...]\r\n", myname);
  1181. +     printf("\r\nRename TAR.EXE to PAX.EXE or CPIO.EXE to get the PAX or CPIO user interface.\r\n");
  1182. + #ifdef DISKACC
  1183. +     printf("\r\nUse the option f with drive letter arguments to access Unix floppy"
  1184. +            "\r\ndisks with tar archives. The disk type is automatically detected.\r\n");
  1185. + #endif
  1186. + #else
  1187.       fprintf(stderr, "Usage: %s -c[bfvw] device block filename..\n", myname);
  1188.       fprintf(stderr, "       %s -r[bvw] device block [filename...]\n", myname);
  1189.       fprintf(stderr, "       %s -t[vf] device\n", myname);
  1190.       fprintf(stderr, "       %s -u[bvw] device block [filename...]\n", myname);
  1191.       fprintf(stderr, "       %s -x[flmovw] device [filename...]\n", myname);
  1192. + #endif
  1193.       exit(1);
  1194.   }
  1195. diff -cb orig/ttyio.c new/ttyio.c
  1196. *** orig/ttyio.c    Mon Dec 18 10:28:36 1989
  1197. --- new/ttyio.c    Fri Dec 24 16:33:46 1993
  1198. ***************
  1199. *** 96,104 ****
  1200.       DBUG_RETURN(-1);
  1201.       }
  1202.       
  1203. ! #ifdef MSDOS
  1204.       setmode(fd, O_TEXT);
  1205. ! #endif /* MSDOS */
  1206.       
  1207.       if (isatty(fd)) {
  1208.       DBUG_RETURN(fd);
  1209. --- 96,104 ----
  1210.       DBUG_RETURN(-1);
  1211.       }
  1212.   
  1213. ! #ifdef PC
  1214.       setmode(fd, O_TEXT);
  1215. ! #endif /* PC */
  1216.   
  1217.       if (isatty(fd)) {
  1218.       DBUG_RETURN(fd);
  1219. ***************
  1220. *** 170,175 ****
  1221. --- 170,176 ----
  1222.           answer[idx++] = c;
  1223.       }
  1224.       }
  1225. +     write(ttyf, "\r\n", 2);
  1226.       if (got == 0) {        /* got an EOF */
  1227.       DBUG_RETURN(-1);
  1228.       }
  1229. ***************
  1230. *** 270,279 ****
  1231.           myname, arvolume + 1, myname);
  1232.       for (;;) {
  1233.       ret = nextask(msg, answer, sizeof(answer));
  1234. !     if (ret == -1 || strcmp(answer, "quit") == 0) {
  1235.           fatal("Aborted");
  1236.       }
  1237. !     if (strcmp(answer, "go") == 0 && open_archive(mode) == 0) {
  1238.           break;
  1239.       }
  1240.       }
  1241. --- 271,280 ----
  1242.           myname, arvolume + 1, myname);
  1243.       for (;;) {
  1244.       ret = nextask(msg, answer, sizeof(answer));
  1245. !     if (ret == -1 || stricmp(answer, "quit") == 0) {
  1246.           fatal("Aborted");
  1247.       }
  1248. !     if (stricmp(answer, "go") == 0 && open_archive(mode) == 0) {
  1249.           break;
  1250.       }
  1251.       }
  1252.