home *** CD-ROM | disk | FTP | other *** search
/ Mega CD-ROM 1 / megacd_rom_1.zip / megacd_rom_1 / GNUISH / CPIO11.ZIP / PATCHES < prev    next >
Text File  |  1990-09-24  |  37KB  |  1,270 lines

  1. *** e:\tmp/RCSt1006704    Sun Sep 23 23:41:22 1990
  2. --- copyin.c    Sun Sep 23 23:24:32 1990
  3. ***************
  4. *** 15,20 ****
  5. --- 15,32 ----
  6.      along with this program; if not, write to the Free Software
  7.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  8.   
  9. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  10. +    This port is also distributed under the terms of the
  11. +    GNU General Public License as published by the
  12. +    Free Software Foundation.
  13. +    Please note that this file is not identical to the
  14. +    original GNU release, you should have received this
  15. +    code as patch to the official release.
  16. +    $Header: e:/gnu/cpio/RCS/copyin.c 1.1.0.2 90/09/23 23:10:58 tho Exp $
  17. +  */
  18.   #include <stdio.h>
  19.   #include <sys/types.h>
  20.   #include <sys/stat.h>
  21. ***************
  22. *** 22,34 ****
  23. --- 34,52 ----
  24.   #define lstat stat
  25.   #endif
  26.   #include <errno.h>
  27. + #ifndef MSDOS            /* sigh, it's `volatile' !!! */
  28.   extern int errno;
  29. + #endif
  30.   #include <fcntl.h>
  31. + #ifndef MSDOS
  32.   #include <sys/file.h>
  33. + #endif
  34.   #ifdef USG
  35.   #include <time.h>
  36.   #include <string.h>
  37. + #ifndef MSDOS
  38.   #include <sys/sysmacros.h>
  39. + #endif
  40.   #else
  41.   #include <sys/time.h>
  42.   #include <strings.h>
  43. ***************
  44. *** 37,43 ****
  45. --- 55,79 ----
  46.   #include "dstring.h"
  47.   #include "extern.h"
  48.   
  49. + #ifdef MSDOS
  50. + extern int mkdir (char *, int);    /* we're cheating! */
  51. + #define major(dev)  (((dev) >> 8) & 0xff)
  52. + #define minor(dev)  ((dev) & 0xff)
  53. + extern int glob_match (char *pattern, char *text, int dot_special);
  54. + extern void read_in_header (struct cpio_header *file_hdr, int in_des);
  55. + static void read_in_ascii (struct cpio_header *file_hdr, int in_des);
  56. + static void read_in_binary (struct cpio_header *file_hdr, int in_des);
  57. + extern void swab_array (short *ptr, int count);
  58. + extern void mode_string (unsigned short mode, char *str);
  59. + extern void print_name_with_quoting (char *p);
  60. + #endif /* MSDOS */
  61. + #ifdef MSDOS
  62. + #define bcopy(s, d, n) memmove ((d), (s), (n))    /* more efficient */
  63. + #else
  64.   void bcopy ();
  65. + #endif
  66.   
  67.   void read_in_ascii ();
  68.   void read_in_binary ();
  69. ***************
  70. *** 138,147 ****
  71. --- 174,191 ----
  72.         swab_array ((short *) file_hdr, 13);
  73.       }
  74.   
  75. + #ifdef MSDOS
  76. +   file_hdr->h_mtime = (long) file_hdr->h_mtimes[0] << 16
  77. +               | file_hdr->h_mtimes[1];
  78. +   file_hdr->h_filesize = (long) file_hdr->h_filesizes[0] << 16
  79. +              | file_hdr->h_filesizes[1];
  80. + #else /* not MSDOS */
  81.     file_hdr->h_mtime = file_hdr->h_mtimes[0] << 16 | file_hdr->h_mtimes[1];
  82.   
  83.     file_hdr->h_filesize = file_hdr->h_filesizes[0] << 16
  84.       | file_hdr->h_filesizes[1];
  85. + #endif /* not MSDOS */
  86.   
  87.     /* Read file name from input.  */
  88.     if (file_hdr->h_name != NULL)
  89. ***************
  90. *** 191,200 ****
  91. --- 235,252 ----
  92.     struct cpio_header file_hdr;    /* Output header information.  */
  93.     int out_file_des;        /* Output file descriptor.  */
  94.     int in_file_des;        /* Input file descriptor.  */
  95. + #ifdef MSDOS
  96. +   int skip_file;        /* Shut up the compiler.  */
  97. + #else
  98.     char skip_file;        /* Flag for use with patterns.  */
  99. + #endif
  100.     int i;            /* Loop index variable.  */
  101.     char *link_name = NULL;    /* Name of hard and symbolic links.  */
  102.   
  103. + #ifdef MSDOS
  104. +   setmode (fileno (stdin), O_BINARY);
  105. + #endif
  106.     /* Initialize copy in.  */
  107.     file_hdr.h_name = NULL;
  108.     ds_init (&new_name, 128);
  109. ***************
  110. *** 202,207 ****
  111. --- 254,267 ----
  112.     /* Open interactive file pair for rename operation.  */
  113.     if (rename_flag)
  114.       {
  115. + #ifdef MSDOS
  116. +       tty_in = fopen ("con", "r");
  117. +       if (tty_in == NULL)
  118. +     error (2, errno, "/dev/tty");
  119. +       tty_out = fopen ("con", "w");
  120. +       if (tty_out == NULL)
  121. +     error (2, errno, "/dev/tty");
  122. + #else /* not MSDOS */
  123.         tty_in = fopen ("/dev/tty", "r");
  124.         if (tty_in == NULL)
  125.       error (2, errno, "/dev/tty");
  126. ***************
  127. *** 208,213 ****
  128. --- 268,274 ----
  129.         tty_out = fopen ("/dev/tty", "w");
  130.         if (tty_out == NULL)
  131.       error (2, errno, "/dev/tty");
  132. + #endif /* not MSDOS */
  133.       }
  134.   
  135.     /* Get date and time if needed for processing the table option. */
  136. ***************
  137. *** 218,225 ****
  138. --- 279,290 ----
  139.     in_file_des = fileno (stdin);
  140.     if (fstat (in_file_des, &file_stat))
  141.       error (1, errno, "standard input is closed");
  142. + #ifdef S_IFBLK
  143.     input_is_special = ((file_stat.st_mode & S_IFMT) == S_IFCHR
  144.                 || (file_stat.st_mode & S_IFMT) == S_IFBLK);
  145. + #else /* not S_IFBLK */
  146. +   input_is_special = ((file_stat.st_mode & S_IFMT) == S_IFCHR);
  147. + #endif /* not S_IFBLK */
  148.     input_is_seekable = ((file_stat.st_mode & S_IFMT) == S_IFREG);
  149.     output_is_seekable = TRUE;
  150.   
  151. ***************
  152. *** 325,330 ****
  153. --- 390,398 ----
  154.           {
  155.           case S_IFREG:
  156.             /* Can the current file be linked to a previously copied file? */
  157. + #ifdef MSDOS
  158. +           link_name = NULL;
  159. + #else /* not MSDOS */
  160.             if (file_hdr.h_nlink > 1)
  161.           {
  162.             link_name = find_inode_file (file_hdr.h_ino);
  163. ***************
  164. *** 349,365 ****
  165. --- 417,445 ----
  166.               link_name = NULL;
  167.               }
  168.           }
  169. + #endif /* not MSDOS */
  170.   
  171.             /* If not linked, copy the contents of the file. */
  172.             if (link_name == NULL)
  173.           {
  174. + #ifdef MSDOS
  175.             out_file_des = open (file_hdr.h_name,
  176. +                        O_CREAT | O_WRONLY | O_BINARY, 0600);
  177. + #else
  178. +           out_file_des = open (file_hdr.h_name,
  179.                          O_CREAT | O_WRONLY, 0600);
  180. + #endif
  181.             if (out_file_des < 0 && create_dir_flag)
  182.               {
  183.                 create_all_directories (file_hdr.h_name);
  184. + #ifdef MSDOS
  185. +               out_file_des = open (file_hdr.h_name,
  186. +                        O_CREAT | O_WRONLY | O_BINARY,
  187. +                        0600);
  188. + #else
  189.                 out_file_des = open (file_hdr.h_name,
  190.                          O_CREAT | O_WRONLY, 0600);
  191. + #endif
  192.               }
  193.             if (out_file_des < 0)
  194.               {
  195. ***************
  196. *** 376,385 ****
  197. --- 456,467 ----
  198.             /* File is now copied; set attributes.  */
  199.             if (chmod (file_hdr.h_name, file_hdr.h_mode) < 0)
  200.               error (0, errno, "%s", file_hdr.h_name);
  201. + #ifndef MSDOS
  202.             if (chown (file_hdr.h_name, file_hdr.h_uid,
  203.                    file_hdr.h_gid) < 0
  204.                 && errno != EPERM)
  205.               error (0, errno, "%s", file_hdr.h_name);
  206. + #endif /* not MSDOS */
  207.             if (retain_time_flag)
  208.               {
  209.                 times[0] = times[1] = file_hdr.h_mtime;
  210. ***************
  211. *** 401,414 ****
  212. --- 483,500 ----
  213.             error (0, errno, "%s", file_hdr.h_name);
  214.             continue;
  215.           }
  216. + #ifndef MSDOS
  217.             if (chown (file_hdr.h_name, file_hdr.h_uid,
  218.                file_hdr.h_gid) < 0
  219.             && errno != EPERM)
  220.           error (0, errno, "%s", file_hdr.h_name);
  221. + #endif /* not MSDOS */
  222.             break;
  223.   
  224.           case S_IFCHR:
  225. + #ifdef S_IFBLK
  226.           case S_IFBLK:
  227. + #endif
  228.   #ifdef S_IFSOCK
  229.           case S_IFSOCK:
  230.   #endif
  231. ***************
  232. *** 415,420 ****
  233. --- 501,507 ----
  234.   #ifdef S_IFIFO
  235.           case S_IFIFO:
  236.   #endif
  237. + #ifndef MSDOS
  238.             res = mknod (file_hdr.h_name, file_hdr.h_mode, file_hdr.h_rdev);
  239.             if (res < 0 && create_dir_flag)
  240.           {
  241. ***************
  242. *** 431,436 ****
  243. --- 518,524 ----
  244.                file_hdr.h_gid) < 0
  245.             && errno != EPERM)
  246.           error (0, errno, "%s", file_hdr.h_name);
  247. + #endif /* not MSDOS */
  248.             break;
  249.   
  250.   #ifdef S_IFLNK
  251. ***************
  252. *** 466,472 ****
  253. --- 554,564 ----
  254.           fprintf (stderr, "%s\n", file_hdr.h_name);
  255.       }
  256.       }
  257. + #ifdef MSDOS
  258. +   res = (int) ((input_bytes + io_block_size - 1) / io_block_size);
  259. + #else
  260.     res = (input_bytes + io_block_size - 1) / io_block_size;
  261. + #endif
  262.     if (res == 1)
  263.       fprintf (stderr, "1 block\n");
  264.     else
  265. ***************
  266. *** 509,520 ****
  267. --- 601,620 ----
  268.       printf ("%-8.8s %-8.8s ", getuser (file_hdr->h_uid),
  269.           getgroup (file_hdr->h_gid));
  270.   
  271. + #ifdef S_IFBLK
  272.     if ((file_hdr->h_mode & S_IFMT) == S_IFCHR
  273.         || (file_hdr->h_mode & S_IFMT) == S_IFBLK)
  274. + #else /* not S_IFBLK */
  275. +   if ((file_hdr->h_mode & S_IFMT) == S_IFCHR)
  276. + #endif /* not S_IFBLK */
  277.       printf ("%3u, %3u ", major (file_hdr->h_rdev),
  278.           minor (file_hdr->h_rdev));
  279.     else
  280. + #ifdef MSDOS
  281. +     printf ("%8lu ", file_hdr->h_filesize);
  282. + #else
  283.       printf ("%8u ", file_hdr->h_filesize);
  284. + #endif
  285.   
  286.     printf ("%s ", tbuf + 4);
  287.   
  288. *** e:\tmp/RCSt1006704    Sun Sep 23 23:41:24 1990
  289. --- copyout.c    Sun Sep 23 23:34:08 1990
  290. ***************
  291. *** 15,20 ****
  292. --- 15,32 ----
  293.      along with this program; if not, write to the Free Software
  294.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  295.   
  296. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  297. +    This port is also distributed under the terms of the
  298. +    GNU General Public License as published by the
  299. +    Free Software Foundation.
  300. +    Please note that this file is not identical to the
  301. +    original GNU release, you should have received this
  302. +    code as patch to the official release.
  303. +    $Header: e:/gnu/cpio/RCS/copyout.c 1.1.0.2 90/09/23 23:33:23 tho Exp $
  304. +  */
  305.   #include <stdio.h>
  306.   #include <sys/types.h>
  307.   #include <sys/stat.h>
  308. ***************
  309. *** 22,30 ****
  310. --- 34,46 ----
  311.   #define lstat stat
  312.   #endif
  313.   #include <errno.h>
  314. + #ifndef MSDOS            /* sigh, it's `volatile' !!! */
  315.   extern int errno;
  316. + #endif
  317.   #include <fcntl.h>
  318. + #ifndef MSDOS
  319.   #include <sys/file.h>
  320. + #endif
  321.   #ifdef USG
  322.   #include <time.h>
  323.   #include <string.h>
  324. ***************
  325. *** 48,55 ****
  326. --- 64,76 ----
  327.       {
  328.         char ascii_header[78];
  329.   
  330.         sprintf (ascii_header,
  331. + #ifdef MSDOS
  332. +            "%06ho%06ho%06ho%06ho%06ho%06ho%06ho%06ho%011lo%06ho%011lo",
  333. + #else
  334.              "%06o%06o%06o%06o%06o%06o%06o%06o%011o%06o%011o",
  335. + #endif
  336.              file_hdr->h_magic & 0xFFFF, file_hdr->h_dev & 0xFFFF,
  337.              file_hdr->h_ino & 0xFFFF, file_hdr->h_mode & 0xFFFF,
  338.              file_hdr->h_uid & 0xFFFF, file_hdr->h_gid & 0xFFFF,
  339. ***************
  340. *** 67,77 ****
  341. --- 88,108 ----
  342.         if (output_size & 1)
  343.       copy_buf_out ("", out_des, 1);
  344.   
  345. + #ifdef MSDOS
  346. +       file_hdr->h_mtimes[0] = (unsigned int) (file_hdr->h_mtime >> 16);
  347. +       file_hdr->h_mtimes[1] = (unsigned int) (file_hdr->h_mtime & 0xFFFF);
  348. +       file_hdr->h_filesizes[0]
  349. +     = (unsigned int) (file_hdr->h_filesize >> 16);
  350. +       file_hdr->h_filesizes[1]
  351. +     = (unsigned int) (file_hdr->h_filesize & 0xFFFF);
  352. + #else /* not MSDOS */
  353.         file_hdr->h_mtimes[0] = file_hdr->h_mtime >> 16;
  354.         file_hdr->h_mtimes[1] = file_hdr->h_mtime & 0xFFFF;
  355.   
  356.         file_hdr->h_filesizes[0] = file_hdr->h_filesize >> 16;
  357.         file_hdr->h_filesizes[1] = file_hdr->h_filesize & 0xFFFF;
  358. + #endif /* not MSDOS */
  359.   
  360.         /* Output the file header. */
  361.         copy_buf_out ((char *) file_hdr, out_des, 26);
  362. ***************
  363. *** 100,105 ****
  364. --- 131,140 ----
  365.     int in_file_des;        /* Source file descriptor. */
  366.     int out_file_des;        /* Output file descriptor. */
  367.   
  368. + #ifdef MSDOS
  369. +   setmode (fileno (stdout), O_BINARY);
  370. + #endif
  371.     /* Initialize copy out. */
  372.     ds_init (&input_name, 128);
  373.     file_hdr.h_magic = 070707;
  374. ***************
  375. *** 108,115 ****
  376. --- 143,154 ----
  377.     out_file_des = fileno (stdout);
  378.     if (fstat (out_file_des, &file_stat))
  379.       error (1, errno, "standard output is closed");
  380. + #ifdef S_IFBLK
  381.     output_is_special = ((file_stat.st_mode & S_IFMT) == S_IFCHR
  382.                  || (file_stat.st_mode & S_IFMT) == S_IFBLK);
  383. + #else /* not S_IFBLK */
  384. +   output_is_special = ((file_stat.st_mode & S_IFMT) == S_IFCHR);
  385. + #endif /* not S_IFBLK */
  386.     output_is_seekable = ((file_stat.st_mode & S_IFMT) == S_IFREG);
  387.   
  388.     /* Copy files with names read from stdin.  */
  389. ***************
  390. *** 144,150 ****
  391. --- 183,194 ----
  392.         switch (file_hdr.h_mode & S_IFMT)
  393.           {
  394.           case S_IFREG:
  395. + #ifdef MSDOS
  396. +           in_file_des = open (input_name.ds_string,
  397. +                   O_RDONLY | O_BINARY, 0);
  398. + #else
  399.             in_file_des = open (input_name.ds_string, O_RDONLY, 0);
  400. + #endif
  401.             if (in_file_des < 0)
  402.           {
  403.             error (0, errno, "%s", input_name.ds_string);
  404. ***************
  405. *** 169,175 ****
  406. --- 213,221 ----
  407.             break;
  408.   
  409.           case S_IFCHR:
  410. + #ifdef S_IFBLK
  411.           case S_IFBLK:
  412. + #endif
  413.   #ifdef S_IFSOCK
  414.           case S_IFSOCK:
  415.   #endif
  416. ***************
  417. *** 223,229 ****
  418. --- 269,279 ----
  419.       }
  420.     empty_output_buffer (out_file_des);
  421.     finish_output_file ("standard output", out_file_des);
  422. + #ifdef MSDOS
  423. +   res = (int) (output_bytes / io_block_size);
  424. + #else
  425.     res = output_bytes / io_block_size;
  426. + #endif
  427.     if (res == 1)
  428.       fprintf (stderr, "1 block\n");
  429.     else
  430. *** e:\tmp/RCSt1006704    Sun Sep 23 23:41:26 1990
  431. --- copypass.c    Sun Sep 23 23:29:26 1990
  432. ***************
  433. *** 15,20 ****
  434. --- 15,32 ----
  435.      along with this program; if not, write to the Free Software
  436.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  437.   
  438. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  439. +    This port is also distributed under the terms of the
  440. +    GNU General Public License as published by the
  441. +    Free Software Foundation.
  442. +    Please note that this file is not identical to the
  443. +    original GNU release, you should have received this
  444. +    code as patch to the official release.
  445. +    $Header: e:/gnu/cpio/RCS/copypass.c 1.1.0.2 90/09/23 23:11:03 tho Exp $
  446. +  */
  447.   #include <stdio.h>
  448.   #include <sys/types.h>
  449.   #include <sys/stat.h>
  450. ***************
  451. *** 22,30 ****
  452. --- 34,46 ----
  453.   #define lstat stat
  454.   #endif
  455.   #include <errno.h>
  456. + #ifndef MSDOS            /* sigh, it's `volatile' !!! */
  457.   extern int errno;
  458. + #endif
  459.   #include <fcntl.h>
  460. + #ifndef MSDOS
  461.   #include <sys/file.h>
  462. + #endif
  463.   #ifdef USG
  464.   #include <time.h>
  465.   #include <string.h>
  466. ***************
  467. *** 36,41 ****
  468. --- 52,61 ----
  469.   #include "dstring.h"
  470.   #include "extern.h"
  471.   
  472. + #ifdef MSDOS
  473. + extern int mkdir (char *, int);    /* we're cheating! */
  474. + #endif
  475.   /* Copy files listed on the standard input into directory `directory_name'.
  476.      If `link_flag', link instead of copying. */
  477.   
  478. ***************
  479. *** 114,119 ****
  480. --- 134,142 ----
  481.       case S_IFREG:
  482.         /* Can the current file be linked to a another file?
  483.            Set link_name to the original file name.  */
  484. + #ifdef MSDOS
  485. +           link_name = NULL;
  486. + #else /* not MSDOS */
  487.         if (link_flag)
  488.           {
  489.             /* User said to link it if possible. */
  490. ***************
  491. *** 154,176 ****
  492. --- 177,215 ----
  493.             link_name = NULL;
  494.           }
  495.           }
  496. + #endif /* not MSDOS */
  497.   
  498.         /* If the file was not linked, copy contents of file. */
  499.         if (link_name == NULL)
  500.           {
  501. + #ifdef MSDOS
  502. +           in_file_des = open (input_name.ds_string,
  503. +                   O_RDONLY | O_BINARY, 0);
  504. + #else
  505.             in_file_des = open (input_name.ds_string, O_RDONLY, 0);
  506. + #endif
  507.             if (in_file_des < 0)
  508.           {
  509.             error (0, errno, "%s", input_name.ds_string);
  510.             continue;
  511.           }
  512. + #ifdef MSDOS
  513.             out_file_des = open (output_name.ds_string,
  514. +                    O_CREAT | O_WRONLY | O_BINARY, 0600);
  515. + #else
  516. +           out_file_des = open (output_name.ds_string,
  517.                      O_CREAT | O_WRONLY, 0600);
  518. + #endif
  519.             if (out_file_des < 0 && create_dir_flag)
  520.           {
  521.             create_all_directories (output_name.ds_string);
  522. + #ifdef MSDOS
  523. +           out_file_des = open (output_name.ds_string,
  524. +                        O_CREAT | O_WRONLY | O_BINARY, 0600);
  525. + #else
  526.             out_file_des = open (output_name.ds_string,
  527.                          O_CREAT | O_WRONLY, 0600);
  528. + #endif
  529.           }
  530.             if (out_file_des < 0)
  531.           {
  532. ***************
  533. *** 188,197 ****
  534. --- 227,238 ----
  535.             /* Set the attributes of the new file.  */
  536.             if (chmod (output_name.ds_string, in_file_stat.st_mode) < 0)
  537.           error (0, errno, "%s", output_name.ds_string);
  538. + #ifndef MSDOS
  539.             if (chown (output_name.ds_string, in_file_stat.st_uid,
  540.                in_file_stat.st_gid) < 0
  541.             && errno != EPERM)
  542.           error (0, errno, "%s", output_name.ds_string);
  543. + #endif /* not MSDOS */
  544.             if (reset_time_flag)
  545.           {
  546.             times[0] = in_file_stat.st_atime;
  547. ***************
  548. *** 216,229 ****
  549. --- 257,274 ----
  550.             error (0, errno, "%s", output_name.ds_string);
  551.             continue;
  552.           }
  553. + #ifndef MSDOS
  554.         if (chown (output_name.ds_string, in_file_stat.st_uid,
  555.                in_file_stat.st_gid) < 0
  556.             && errno != EPERM)
  557.           error (0, errno, "%s", output_name.ds_string);
  558. + #endif /* not MSDOS */
  559.         break;
  560.   
  561.       case S_IFCHR:
  562. + #ifdef S_IFBLK
  563.       case S_IFBLK:
  564. + #endif
  565.   #ifdef S_IFIFO
  566.       case S_IFIFO:
  567.   #endif
  568. ***************
  569. *** 230,235 ****
  570. --- 275,281 ----
  571.   #ifdef S_IFSOCK
  572.       case S_IFSOCK:
  573.   #endif
  574. + #ifndef MSDOS
  575.          res = mknod (output_name.ds_string, in_file_stat.st_mode,
  576.                  in_file_stat.st_rdev);
  577.         if (res < 0 && create_dir_flag)
  578. ***************
  579. *** 247,252 ****
  580. --- 293,299 ----
  581.                in_file_stat.st_gid) < 0
  582.             && errno != EPERM)
  583.           error (0, errno, "%s", output_name.ds_string);
  584. + #endif /* not MSDOS */
  585.         break;
  586.   
  587.   #ifdef S_IFLNK
  588. ***************
  589. *** 286,292 ****
  590. --- 333,343 ----
  591.       fprintf (stderr, "%s\n", output_name.ds_string);
  592.       }
  593.   
  594. + #ifdef MSDOS
  595. +   res = (int) (output_bytes / io_block_size);
  596. + #else
  597.     res = output_bytes / io_block_size;
  598. + #endif
  599.     if (res == 1)
  600.       fprintf (stderr, "1 block\n");
  601.     else
  602. *** e:\tmp/RCSt1006704    Sun Sep 23 23:41:30 1990
  603. --- dstring.c    Sun Sep 23 23:29:48 1990
  604. ***************
  605. *** 15,20 ****
  606. --- 15,32 ----
  607.      along with this program; if not, write to the Free Software
  608.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  609.   
  610. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  611. +    This port is also distributed under the terms of the
  612. +    GNU General Public License as published by the
  613. +    Free Software Foundation.
  614. +    Please note that this file is not identical to the
  615. +    original GNU release, you should have received this
  616. +    code as patch to the official release.
  617. +    $Header: e:/gnu/cpio/RCS/dstring.c 1.1.0.2 90/09/23 23:11:06 tho Exp $
  618. +  */
  619.   #include <stdio.h>
  620.   #ifdef USG
  621.   #include <string.h>
  622. ***************
  623. *** 23,30 ****
  624. --- 35,47 ----
  625.   #endif
  626.   #include "dstring.h"
  627.   
  628. + #ifdef MSDOS
  629. + extern char *xmalloc (unsigned int size);
  630. + extern char *xrealloc (char *ptr, unsigned int size);
  631. + #else /* not MSDOS */
  632.   char *xmalloc ();
  633.   char *xrealloc ();
  634. + #endif /* not MSDOS */
  635.   
  636.   /* Initialiaze dynamic string STRING with space for SIZE characters.  */
  637.   
  638. *** e:\tmp/RCSt1006704    Sun Sep 23 23:41:30 1990
  639. --- dstring.h    Sun Sep 23 23:24:38 1990
  640. ***************
  641. *** 15,20 ****
  642. --- 15,38 ----
  643.      along with this program; if not, write to the Free Software
  644.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  645.   
  646. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  647. +    This port is also distributed under the terms of the
  648. +    GNU General Public License as published by the
  649. +    Free Software Foundation.
  650. +    Please note that this file is not identical to the
  651. +    original GNU release, you should have received this
  652. +    code as patch to the official release.
  653. +    $Header: e:/gnu/cpio/RCS/dstring.h 1.1.0.2 90/09/23 23:11:17 tho Exp $
  654. +  */
  655. + #ifdef MSDOS
  656. + #ifndef FILE
  657. + #include <stdio.h>
  658. + #endif
  659. + #endif
  660.   #ifndef NULL
  661.   #define NULL 0
  662.   #endif
  663. ***************
  664. *** 42,47 ****
  665. --- 60,71 ----
  666.   #define ds_index(s, c)        index ((s)->ds_string, c)
  667.   #define ds_rindex(s, c)        rindex ((s)->ds_string, c)
  668.   
  669. + #ifdef MSDOS
  670. + extern void ds_init (dynamic_string *string, int size);
  671. + extern void ds_resize (dynamic_string *string, int size);
  672. + extern char *ds_fgets (FILE *f, dynamic_string *s);
  673. + #else /* not MSDOS */
  674.   void ds_init ();
  675.   void ds_resize ();
  676.   char *ds_fgets ();
  677. + #endif /* not MSDOS */
  678. *** e:\tmp/RCSt1006704    Sun Sep 23 23:41:32 1990
  679. --- extern.h    Sun Sep 23 23:24:42 1990
  680. ***************
  681. *** 15,20 ****
  682. --- 15,38 ----
  683.      along with this program; if not, write to the Free Software
  684.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  685.   
  686. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  687. +    This port is also distributed under the terms of the
  688. +    GNU General Public License as published by the
  689. +    Free Software Foundation.
  690. +    Please note that this file is not identical to the
  691. +    original GNU release, you should have received this
  692. +    code as patch to the official release.
  693. +    $Header: e:/gnu/cpio/RCS/extern.h 1.1.0.2 90/09/23 23:11:18 tho Exp $
  694. +  */
  695. + #ifdef MSDOS
  696. + #define LONG long
  697. + #else
  698. + #define LONG int
  699. + #endif
  700.   extern int reset_time_flag;
  701.   extern int io_block_size;
  702.   extern int binary_flag;
  703. ***************
  704. *** 31,49 ****
  705.   
  706.   extern char *input_buffer, *output_buffer;
  707.   extern char *in_buff, *out_buff;
  708. ! extern int input_size, output_size;
  709. ! extern int input_bytes, output_bytes;
  710.   extern char *directory_name;
  711.   extern char **save_patterns;
  712.   extern int num_patterns;
  713.   extern char input_is_special;
  714.   extern char output_is_special;
  715.   extern char input_is_seekable;
  716.   extern char output_is_seekable;
  717.   extern char *program_name;
  718.   extern int (*xstat) ();
  719.   extern void (*copy_function) ();
  720.   
  721.   long lseek ();
  722.   char *malloc ();
  723.   char *realloc ();
  724. --- 49,111 ----
  725.   
  726.   extern char *input_buffer, *output_buffer;
  727.   extern char *in_buff, *out_buff;
  728. ! extern LONG input_size, output_size;
  729. ! extern LONG input_bytes, output_bytes;
  730.   extern char *directory_name;
  731.   extern char **save_patterns;
  732.   extern int num_patterns;
  733. + #ifdef MSDOS            /* shut up the compiler */
  734. + extern int input_is_special;
  735. + extern int output_is_special;
  736. + extern int input_is_seekable;
  737. + extern int output_is_seekable;
  738. + #else /* not MSDOS */
  739.   extern char input_is_special;
  740.   extern char output_is_special;
  741.   extern char input_is_seekable;
  742.   extern char output_is_seekable;
  743. + #endif /* not MSDOS */
  744.   extern char *program_name;
  745. + #ifdef MSDOS
  746. + extern int (*xstat) (char *name, struct stat *statb);
  747. + extern void (*copy_function) (void);
  748. + #else
  749.   extern int (*xstat) ();
  750.   extern void (*copy_function) ();
  751. + #endif
  752. + #ifdef MSDOS
  753.   
  754. + #include <stdlib.h>
  755. + #include <io.h>
  756. + extern int utime (char *, long *);    /* we're cheating... */
  757. + extern char *copystring (char *string);
  758. + extern char *find_inode_file (unsigned int node_num);
  759. + extern char *getgroup (int gid);
  760. + extern char *getuser (int uid);
  761. + extern char *xmalloc (unsigned int size);
  762. + extern void add_inode (unsigned short node_num, char *file_name);
  763. + extern void copy_buf_out (char *in_buf, int out_des, LONG num_bytes);
  764. + extern void copy_files (int in_des, int out_des, LONG num_bytes);
  765. + extern void copy_in_buf (char *in_buf, int in_des, LONG num_bytes);
  766. + extern void create_all_directories (char *name);
  767. + extern void empty_output_buffer (int out_des);
  768. + extern void error (int status, int errnum, char *message, ...);
  769. + extern void finish_output_file (char *path, int out_des);
  770. + extern void get_next_reel (int tape_des);
  771. + extern void hash_insert (struct inode_val *new_value);
  772. + extern void long_format (struct cpio_header *file_hdr, char *link_name);
  773. + extern void process_copy_in (void);
  774. + extern void process_copy_out (void);
  775. + extern void process_copy_pass (void);
  776. + extern void toss_input (int in_des, LONG num_bytes);
  777. + extern void write_out_header (struct cpio_header *file_hdr, int out_des);
  778. + #else /* not MSDOS */
  779.   long lseek ();
  780.   char *malloc ();
  781.   char *realloc ();
  782. ***************
  783. *** 70,72 ****
  784. --- 132,136 ----
  785.   void protection ();
  786.   void toss_input ();
  787.   void write_out_header ();
  788. + #endif /* not MSDOS */
  789. *** e:\tmp/RCSt1006704    Sun Sep 23 23:41:34 1990
  790. --- filemode.c    Sun Sep 23 23:31:36 1990
  791. ***************
  792. *** 14,19 ****
  793. --- 14,31 ----
  794.      You should have received a copy of the GNU General Public License
  795.      along with this program; if not, write to the Free Software
  796.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  797. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  798. +    This port is also distributed under the terms of the
  799. +    GNU General Public License as published by the
  800. +    Free Software Foundation.
  801. +    Please note that this file is not identical to the
  802. +    original GNU release, you should have received this
  803. +    code as patch to the official release.
  804. +    $Header: e:/gnu/cpio/RCS/filemode.c 1.1.0.2 90/09/23 23:11:07 tho Exp $
  805. +  */
  806.   
  807.   #include <sys/types.h>
  808.   #include <sys/stat.h>
  809. ***************
  810. *** 23,32 ****
  811. --- 35,52 ----
  812.   #define S_IEXEC S_IXUSR
  813.   #endif
  814.   
  815. + #ifdef MSDOS
  816. + extern    void filemodestring (struct stat *statp, char *str);
  817. + extern    void mode_string (unsigned short mode, char *str);
  818. + static    char ftypelet (unsigned short bits);
  819. + static    void rwx (unsigned short bits, char *chars);
  820. + static    void setst (unsigned short bits, char *chars);
  821. + #else /* not MSDOS */
  822.   void mode_string ();
  823.   static char ftypelet ();
  824.   static void rwx ();
  825.   static void setst ();
  826. + #endif /* not MSDOS */
  827.   
  828.   /* filemodestring - fill in string STR with an ls-style ASCII
  829.      representation of the st_mode field of file stats block STATP.
  830. *** e:\tmp/RCSt1006704    Sun Sep 23 23:41:34 1990
  831. --- global.c    Sun Sep 23 23:30:02 1990
  832. ***************
  833. *** 15,23 ****
  834. --- 15,39 ----
  835.      along with this program; if not, write to the Free Software
  836.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  837.   
  838. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  839. +    This port is also distributed under the terms of the
  840. +    GNU General Public License as published by the
  841. +    Free Software Foundation.
  842. +    Please note that this file is not identical to the
  843. +    original GNU release, you should have received this
  844. +    code as patch to the official release.
  845. +    $Header: e:/gnu/cpio/RCS/global.c 1.1.0.2 90/09/23 23:11:09 tho Exp $
  846. +  */
  847.   #include "cpio.h"
  848.   #include "dstring.h"
  849.   
  850. + #ifdef MSDOS
  851. + #include "extern.h"
  852. + #endif
  853.   /* If TRUE, reset access times after reading files (-a). */
  854.   int reset_time_flag = FALSE;
  855.   
  856. ***************
  857. *** 67,76 ****
  858.   char *in_buff, *out_buff;
  859.   
  860.   /* Current number of bytes stored at `input_buff' and `output_buff'. */
  861. ! int input_size, output_size;
  862.   
  863.   /* Total number of bytes read and written for all files. */
  864. ! int input_bytes, output_bytes;
  865.   
  866.   /* Saving of argument values for later reference. */
  867.   char *directory_name;
  868. --- 83,92 ----
  869.   char *in_buff, *out_buff;
  870.   
  871.   /* Current number of bytes stored at `input_buff' and `output_buff'. */
  872. ! LONG input_size, output_size;
  873.   
  874.   /* Total number of bytes read and written for all files. */
  875. ! LONG input_bytes, output_bytes;
  876.   
  877.   /* Saving of argument values for later reference. */
  878.   char *directory_name;
  879. ***************
  880. *** 78,91 ****
  881. --- 94,120 ----
  882.   int num_patterns;
  883.   
  884.   /* TRUE if input (cpio -i) or output (cpio -o) is a device node. */
  885. + #ifdef MSDOS            /* shut up the compiler */
  886. + int input_is_special = FALSE;
  887. + int output_is_special = FALSE;
  888. + #else
  889.   char input_is_special = FALSE;
  890.   char output_is_special = FALSE;
  891. + #endif
  892.   
  893.   /* TRUE if lseek works on the input. */
  894. + #ifdef MSDOS            /* shut up the compiler */
  895. + int input_is_seekable = FALSE;
  896. + #else
  897.   char input_is_seekable = FALSE;
  898. + #endif
  899.   
  900.   /* TRUE if lseek works on the output. */
  901. + #ifdef MSDOS            /* shut up the compiler */
  902. + int output_is_seekable = FALSE;
  903. + #else
  904.   char output_is_seekable = FALSE;
  905. + #endif
  906.   
  907.   /* The name this program was run with. */
  908.   char *program_name;
  909. ***************
  910. *** 92,98 ****
  911. --- 121,135 ----
  912.   
  913.   /* A pointer to either lstat or stat, depending on whether
  914.      dereferencing of symlinks is done for input files.  */
  915. + #ifdef MSDOS
  916. + int (*xstat) (char *name, struct stat *statb);
  917. + #else
  918.   int (*xstat) ();
  919. + #endif
  920.   
  921.   /* Which copy operation to perform. (-i, -o, -p) */
  922. + #ifdef MSDOS
  923. + void (*copy_function) (void) = 0;
  924. + #else
  925.   void (*copy_function) () = 0;
  926. + #endif
  927. *** e:\tmp/RCSt1006704    Sun Sep 23 23:41:36 1990
  928. --- main.c    Sun Sep 23 23:30:16 1990
  929. ***************
  930. *** 17,22 ****
  931. --- 17,34 ----
  932.   
  933.   /* Written by Philip A. Nelson and David MacKenzie.  */
  934.   
  935. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  936. +    This port is also distributed under the terms of the
  937. +    GNU General Public License as published by the
  938. +    Free Software Foundation.
  939. +    Please note that this file is not identical to the
  940. +    original GNU release, you should have received this
  941. +    code as patch to the official release.
  942. +    $Header: e:/gnu/cpio/RCS/main.c 1.1.0.2 90/09/23 23:11:10 tho Exp $
  943. +  */
  944.   #include <stdio.h>
  945.   #include <sys/types.h>
  946.   #include <sys/stat.h>
  947. ***************
  948. *** 35,40 ****
  949. --- 47,59 ----
  950.   
  951.   int lstat ();
  952.   int stat ();
  953. + #ifdef MSDOS
  954. + extern void usage (void);
  955. + extern void main (int argc, char **argv);
  956. + extern void process_args (int argc, char **argv);
  957. + extern void initialize_buffers (void);
  958. + #endif /* MSDOS */
  959.   
  960.   struct option long_opts[] =
  961.   {
  962. *** e:\tmp/RCSt1006704    Sun Sep 23 23:41:38 1990
  963. --- util.c    Sun Sep 23 23:30:52 1990
  964. ***************
  965. *** 15,28 ****
  966. --- 15,44 ----
  967.      along with this program; if not, write to the Free Software
  968.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  969.   
  970. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  971. +    This port is also distributed under the terms of the
  972. +    GNU General Public License as published by the
  973. +    Free Software Foundation.
  974. +    Please note that this file is not identical to the
  975. +    original GNU release, you should have received this
  976. +    code as patch to the official release.
  977. +    $Header: e:/gnu/cpio/RCS/util.c 1.1.0.2 90/09/23 23:11:12 tho Exp $
  978. +  */
  979.   #include <stdio.h>
  980.   #include <pwd.h>
  981. + #ifndef MSDOS
  982.   #include <grp.h>
  983. + #endif
  984.   #include <sys/types.h>
  985.   #include <sys/stat.h>
  986.   #include <errno.h>
  987. + #ifndef MSDOS            /* sigh, it's `volatile' !!! */
  988.   extern int errno;
  989.   #include <sys/ioctl.h>
  990. + #endif
  991.   #ifdef USG
  992.   #include <string.h>
  993.   #else
  994. ***************
  995. *** 34,39 ****
  996. --- 50,63 ----
  997.   #include "cpio.h"
  998.   #include "extern.h"
  999.   
  1000. + #ifdef MSDOS
  1001. + #include <assert.h>
  1002. + extern int mkdir (char *, int);    /* we're cheating! */
  1003. + extern void fill_input_buffer (int in_des, int num_bytes);
  1004. + extern void tape_offline (int tape_des);
  1005. + extern char *xrealloc (char *ptr, unsigned int size);
  1006. + #endif /* MSDOS */
  1007.   /* TRUE if the last buffer written by `empty_output_buffer' was a block
  1008.      of zeros spaced forward with lseek. */
  1009.   static char last_write_made_hole;
  1010. ***************
  1011. *** 46,52 ****
  1012.   empty_output_buffer (out_des)
  1013.        int out_des;
  1014.   {
  1015. !   int bytes_written;
  1016.     char *cp;
  1017.     int *ip;
  1018.   
  1019. --- 70,76 ----
  1020.   empty_output_buffer (out_des)
  1021.        int out_des;
  1022.   {
  1023. !   LONG bytes_written;
  1024.     char *cp;
  1025.     int *ip;
  1026.   
  1027. ***************
  1028. *** 76,82 ****
  1029. --- 100,111 ----
  1030.       }
  1031.     if (last_write_made_hole == FALSE)
  1032.       {
  1033. + #ifdef MSDOS
  1034. +       assert (output_size < 0xffffL);
  1035. +       bytes_written = write (out_des, output_buffer, (size_t) output_size);
  1036. + #else
  1037.         bytes_written = write (out_des, output_buffer, output_size);
  1038. + #endif
  1039.         if (bytes_written != output_size)
  1040.       {
  1041.         error (0, errno, "write error");
  1042. ***************
  1043. *** 83,89 ****
  1044. --- 112,123 ----
  1045.         if (bytes_written == 0 && output_is_special)
  1046.           {
  1047.             get_next_reel (out_des);
  1048. + #ifdef MSDOS
  1049. +           bytes_written = write (out_des, output_buffer,
  1050. +                      (size_t) output_size);
  1051. + #else
  1052.             bytes_written = write (out_des, output_buffer, output_size);
  1053. + #endif
  1054.           }
  1055.         if (bytes_written != output_size)
  1056.           exit (1);
  1057. ***************
  1058. *** 151,157 ****
  1059.   copy_buf_out (in_buf, out_des, num_bytes)
  1060.        char *in_buf;
  1061.        int out_des;
  1062. !      int num_bytes;
  1063.   {
  1064.     /* Copy the bytes one at a time, and empty the output buffer
  1065.        when it is full.  */
  1066. --- 185,191 ----
  1067.   copy_buf_out (in_buf, out_des, num_bytes)
  1068.        char *in_buf;
  1069.        int out_des;
  1070. !      LONG num_bytes;
  1071.   {
  1072.     /* Copy the bytes one at a time, and empty the output buffer
  1073.        when it is full.  */
  1074. ***************
  1075. *** 172,178 ****
  1076.   copy_in_buf (in_buf, in_des, num_bytes)
  1077.        char *in_buf;
  1078.        int in_des;
  1079. !      int num_bytes;
  1080.   {
  1081.     while (num_bytes-- > 0)
  1082.       {
  1083. --- 206,212 ----
  1084.   copy_in_buf (in_buf, in_des, num_bytes)
  1085.        char *in_buf;
  1086.        int in_des;
  1087. !      LONG num_bytes;
  1088.   {
  1089.     while (num_bytes-- > 0)
  1090.       {
  1091. ***************
  1092. *** 190,196 ****
  1093.   void
  1094.   toss_input (in_des, num_bytes)
  1095.        int in_des;
  1096. !      int num_bytes;
  1097.   {
  1098.     int num_toss;            /* Number of io_block_size blocks to toss.  */
  1099.     int i;            /* Index for loop.  */
  1100. --- 224,230 ----
  1101.   void
  1102.   toss_input (in_des, num_bytes)
  1103.        int in_des;
  1104. !      LONG num_bytes;
  1105.   {
  1106.     int num_toss;            /* Number of io_block_size blocks to toss.  */
  1107.     int i;            /* Index for loop.  */
  1108. ***************
  1109. *** 202,212 ****
  1110. --- 236,254 ----
  1111.        them or read them from tape.  The last partial block is then read
  1112.        and prepared for a toss of less than one full block.  */
  1113.         num_bytes -= input_size;
  1114. + #ifdef MSDOS
  1115. +       num_toss = (int) (num_bytes / io_block_size);
  1116. + #else
  1117.         num_toss = num_bytes / io_block_size;
  1118. + #endif
  1119.         if (input_is_seekable)
  1120.       {
  1121.         /* We can seek past the blocks, saving input disk reads. */
  1122. + #ifdef MSDOS
  1123. +       if (lseek (in_des, (long) num_toss * (long) io_block_size, 1) < 0L)
  1124. + #else
  1125.         if (lseek (in_des, (long) (num_toss * io_block_size), 1) < 0L)
  1126. + #endif
  1127.           error (1, errno, "cannot seek on input");
  1128.         input_bytes += num_toss * io_block_size;
  1129.       }
  1130. ***************
  1131. *** 216,222 ****
  1132. --- 258,268 ----
  1133.         for (i = 1; i <= num_toss; i++)
  1134.           fill_input_buffer (in_des, io_block_size);
  1135.       }
  1136. + #ifdef MSDOS
  1137. +       num_bytes -= (long) num_toss * (long) io_block_size;
  1138. + #else
  1139.         num_bytes -= num_toss * io_block_size;
  1140. + #endif
  1141.         /* Get next block containing last "few" bytes to toss.  */
  1142.         fill_input_buffer (in_des, io_block_size);
  1143.       }
  1144. ***************
  1145. *** 238,246 ****
  1146.   copy_files (in_des, out_des, num_bytes)
  1147.        int in_des;
  1148.        int out_des;
  1149. !      int num_bytes;
  1150.   {
  1151. !   int size;
  1152.   
  1153.     while (num_bytes > 0)
  1154.       {
  1155. --- 284,292 ----
  1156.   copy_files (in_des, out_des, num_bytes)
  1157.        int in_des;
  1158.        int out_des;
  1159. !      LONG num_bytes;
  1160.   {
  1161. !   LONG size;
  1162.   
  1163.     while (num_bytes > 0)
  1164.       {
  1165. ***************
  1166. *** 555,560 ****
  1167. --- 601,614 ----
  1168.     int c;
  1169.   
  1170.     /* Open files for interactive communication.  */
  1171. + #ifdef MSDOS
  1172. +   tty_in = fopen ("con", "r");
  1173. +   if (tty_in == NULL)
  1174. +     error (2, errno, "/dev/tty");
  1175. +   tty_out = fopen ("con", "w");
  1176. +   if (tty_out == NULL)
  1177. +     error (2, errno, "/dev/tty");
  1178. + #else /* not MSDOS */
  1179.     tty_in = fopen ("/dev/tty", "r");
  1180.     if (tty_in == NULL)
  1181.       error (2, errno, "/dev/tty");
  1182. ***************
  1183. *** 561,566 ****
  1184. --- 615,621 ----
  1185.     tty_out = fopen ("/dev/tty", "w");
  1186.     if (tty_out == NULL)
  1187.       error (2, errno, "/dev/tty");
  1188. + #endif /* not MSDOS */
  1189.   
  1190.     /* Give message and wait for carrage return.  User should hit carrage return
  1191.        only after loading the next tape.  */
  1192. *** e:\tmp/RCSt1006704    Sun Sep 23 23:41:40 1990
  1193. --- version.c    Sun Sep 23 23:31:52 1990
  1194. ***************
  1195. *** 15,18 ****
  1196. --- 15,37 ----
  1197.      along with this program; if not, write to the Free Software
  1198.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  1199.   
  1200. + /* MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  1201. +    This port is also distributed under the terms of the
  1202. +    GNU General Public License as published by the
  1203. +    Free Software Foundation.
  1204. +    Please note that this file is not identical to the
  1205. +    original GNU release, you should have received this
  1206. +    code as patch to the official release.
  1207. +    $Header: e:/gnu/cpio/RCS/version.c 1.1.0.2 90/09/23 23:11:16 tho Exp $
  1208. +  */
  1209. + #ifdef MSDOS
  1210. + char *version_string =
  1211. +   "GNU cpio version 1.1  (compiled " __DATE__ " " __TIME__ " for MS-DOS)\n";
  1212. + #else
  1213.   char *version_string = "GNU cpio version 1.1\n";
  1214. + #endif
  1215.