home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / gnu / djgpp / diffs / texinfo-.1 / makeinfo / makeinfo.c
Encoding:
Text File  |  1993-11-28  |  4.0 KB  |  139 lines

  1. *** orig/texinfo-.1/makeinfo/makeinfo.c    Sun Aug 29 18:41:40 1993
  2. --- src/texinfo-.1/makeinfo/makeinfo.c    Sun Aug 29 19:26:02 1993
  3. ***************
  4. *** 1040,1046 ****
  5. --- 1040,1050 ----
  6.   
  7.     filename = fullpath;
  8.   
  9. + #ifdef __MSDOS__
  10. +   file = open (filename, O_RDONLY | O_TEXT); /* allows DOS-Edited cr/lf'ed */
  11. + #else                                        /* files to be read (HBB) */
  12.     file = open (filename, O_RDONLY);
  13. + #endif
  14.     if (file < 0)
  15.       goto error_exit;
  16.   
  17. ***************
  18. *** 1051,1064 ****
  19.        readable bytes is always less than this value.  The arcane
  20.        mysteries of VMS/RMS are too much to probe, so this hack
  21.       suffices to make things work. */
  22. ! #if defined (VMS)
  23.     while ((n = read (file, result + count, fileinfo.st_size)) > 0)
  24.       count += n;
  25.     if (n == -1)
  26. ! #else /* !VMS */
  27.       count = fileinfo.st_size;
  28.       if (read (file, result, fileinfo.st_size) != fileinfo.st_size)
  29. ! #endif /* !VMS */
  30.     error_exit:
  31.       {
  32.         if (result)
  33. --- 1055,1068 ----
  34.        readable bytes is always less than this value.  The arcane
  35.        mysteries of VMS/RMS are too much to probe, so this hack
  36.       suffices to make things work. */
  37. ! #if defined (VMS) || defined (__MSDOS__)
  38.     while ((n = read (file, result + count, fileinfo.st_size)) > 0)
  39.       count += n;
  40.     if (n == -1)
  41. ! #else /* !VMS || __MSDOS__ */
  42.       count = fileinfo.st_size;
  43.       if (read (file, result, fileinfo.st_size) != fileinfo.st_size)
  44. ! #endif /* !VMS || __MSDOS__ */
  45.     error_exit:
  46.       {
  47.         if (result)
  48. ***************
  49. *** 1800,1806 ****
  50. --- 1804,1814 ----
  51.         if (!real_output_filename)
  52.       real_output_filename = expand_filename (output_filename, name);
  53.   
  54. + #ifdef __MSDOS__
  55. +       output_stream = fopen (real_output_filename, "wb");
  56. + #else
  57.         output_stream = fopen (real_output_filename, "w");
  58. + #endif
  59.       }
  60.   
  61.     if (output_stream == NULL)
  62. ***************
  63. *** 2771,2776 ****
  64. --- 2779,2785 ----
  65.     return (-1);
  66.   }
  67.   
  68. + #ifndef __MSDOS__
  69.   /* Whoops, Unix doesn't have stricmp. */
  70.   
  71.   /* Case independent string compare. */
  72. ***************
  73. *** 2794,2799 ****
  74. --- 2803,2809 ----
  75.       return (ch1 - ch2);
  76.       }
  77.   }
  78. + #endif
  79.   
  80.   enum insertion_type { menu, quotation, lisp, smalllisp, example,
  81.     smallexample, display, itemize, format, enumerate, cartouche, table,
  82. ***************
  83. *** 4610,4615 ****
  84. --- 4620,4633 ----
  85.   
  86.             split_filename = (char *) xmalloc
  87.               (10 + strlen (root_pathname) + strlen (root_filename));
  88. + #if defined (__MSDOS__)
  89. +           sprintf
  90. +             (split_filename,
  91. +               "%s%s.%d", root_pathname, root_filename, which_file);
  92. +           fd = open
  93. +             (split_filename, O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666);
  94. + #else /* __MSDOS__ */
  95.             sprintf
  96.               (split_filename,
  97.                "%s%s-%d", root_pathname, root_filename, which_file);
  98. ***************
  99. *** 4616,4621 ****
  100. --- 4634,4640 ----
  101.   
  102.             fd = open
  103.               (split_filename, O_WRONLY | O_TRUNC | O_CREAT, 0666);
  104. + #endif /* __MSDOS__ */
  105.   
  106.             if ((fd < 0) ||
  107.                 (write (fd, the_header, header_size) != header_size) ||
  108. ***************
  109. *** 4636,4643 ****
  110. --- 4655,4667 ----
  111.                 indirect_info += strlen (indirect_info);
  112.               }
  113.   
  114. + #if defined (__MSDOS__)
  115. +           sprintf (indirect_info, "%s.%d: %d\n",
  116. +                root_filename, which_file, file_top);
  117. + #else /* __MSDOS__ */
  118.             sprintf (indirect_info, "%s-%d: %d\n",
  119.                  root_filename, which_file, file_top);
  120. + #endif /* __MSDOS__ */
  121.   
  122.             free (split_filename);
  123.             indirect_info += strlen (indirect_info);
  124. ***************
  125. *** 4651,4657 ****
  126. --- 4675,4685 ----
  127.       /* We have sucessfully created the subfiles.  Now write out the
  128.          original again.  We must use `output_stream', or
  129.          write_tag_table_indirect () won't know where to place the output. */
  130. + #ifdef __MSDOS__
  131. +     output_stream = fopen (filename, "wb");
  132. + #else
  133.       output_stream = fopen (filename, "w");
  134. + #endif
  135.       if (!output_stream)
  136.         {
  137.       perror (filename);
  138.