home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / GRECODE / PATCHES.OS2 < prev    next >
Text File  |  1994-01-10  |  4KB  |  169 lines

  1. Only in new: config.h
  2. Only in new: Makefile.os2
  3. Only in new: patches.os2
  4. diff -cb orig/recode.c new/recode.c
  5. *** orig/recode.c    Wed Dec 22 04:05:20 1993
  6. --- new/recode.c    Sun Jan 09 23:40:54 1994
  7. ***************
  8. *** 29,35 ****
  9.      `:AFTER' or `BEFORE:' are used.  */
  10.   
  11.   #ifndef DEFAULT_CHARSET
  12. ! #ifdef MSDOS
  13.   #define DEFAULT_CHARSET "ibmpc"
  14.   #else
  15.   #ifdef atarist
  16. --- 29,35 ----
  17.      `:AFTER' or `BEFORE:' are used.  */
  18.   
  19.   #ifndef DEFAULT_CHARSET
  20. ! #if defined(MSDOS) || defined(OS2)
  21.   #define DEFAULT_CHARSET "ibmpc"
  22.   #else
  23.   #ifdef atarist
  24. ***************
  25. *** 55,60 ****
  26. --- 55,65 ----
  27.   #define strrchr rindex
  28.   #endif
  29.   
  30. + #ifdef OS2
  31. + #include <io.h>
  32. + #include <fcntl.h>
  33. + #endif
  34.   #ifdef MSDOS
  35.   #include <dir.h>
  36.   #define unlink dummy1
  37. ***************
  38. *** 1422,1433 ****
  39.   
  40.     /* Choose names for intermediate files.  Use "" for delaying them.  */
  41.   
  42. ! #ifdef MSDOS
  43.     strcpy (temp_name_1, "recodex1.tmp");
  44.     strcpy (temp_name_2, "recodex2.tmp");
  45.   #else
  46. !   *temp_name_1 = '\0';
  47. !   *temp_name_2 = '\0';
  48.   #endif
  49.     temp_input_name = temp_name_1;
  50.     temp_output_name = temp_name_2;
  51. --- 1427,1438 ----
  52.   
  53.     /* Choose names for intermediate files.  Use "" for delaying them.  */
  54.   
  55. ! #if defined(MSDOS) || defined(OS2)
  56.     strcpy (temp_name_1, "recodex1.tmp");
  57.     strcpy (temp_name_2, "recodex2.tmp");
  58.   #else
  59. !   temp_name_1[0] = '\0';
  60. !   temp_name_2[0] = '\0';
  61.   #endif
  62.     temp_input_name = temp_name_1;
  63.     temp_output_name = temp_name_2;
  64. ***************
  65. *** 1479,1485 ****
  66.         else
  67.       {
  68.   #ifdef USE_TMPNAM
  69. ! #ifndef MSDOS
  70.         if (*temp_output_name == '\0')
  71.           tmpnam (temp_output_name);
  72.   #endif
  73. --- 1484,1490 ----
  74.         else
  75.       {
  76.   #ifdef USE_TMPNAM
  77. ! #if defined(MSDOS) || defined(OS2)
  78.         if (*temp_output_name == '\0')
  79.           tmpnam (temp_output_name);
  80.   #endif
  81. ***************
  82. *** 1718,1730 ****
  83.     FILE *output_file;        /* output file from recoding step */
  84.     const STEP *step;        /* current step */
  85.   
  86. ! #ifdef MSDOS
  87.     if (!input_name)
  88.       setmode (fileno (stdin), O_BINARY);
  89.     if (!output_name)
  90.       setmode (fileno (stdout), O_BINARY);
  91.     _fmode = O_BINARY;
  92.   #endif
  93.   
  94.     if (verbose_option && input_name)
  95.       {
  96. --- 1723,1742 ----
  97.     FILE *output_file;        /* output file from recoding step */
  98.     const STEP *step;        /* current step */
  99.   
  100. ! #if defined(MSDOS) || defined(OS2)
  101.     if (!input_name)
  102.       setmode (fileno (stdin), O_BINARY);
  103.     if (!output_name)
  104.       setmode (fileno (stdout), O_BINARY);
  105. + #ifdef __EMX__
  106. +   {
  107. +     extern int _fmode_bin;
  108. +     _fmode_bin = 1;
  109. +   }
  110. + #else
  111.     _fmode = O_BINARY;
  112.   #endif
  113. + #endif
  114.   
  115.     if (verbose_option && input_name)
  116.       {
  117. ***************
  118. *** 1921,1926 ****
  119. --- 1933,1939 ----
  120.            decoding_charset_flag ? "--list" : "--help");
  121.     else
  122.       {
  123. +       printf ("\n%s\n\n", version_string);
  124.         printf ("\
  125.   Usage: %s [OPTION]... [CHARSET]\n", program_name);
  126.   
  127. ***************
  128. *** 2243,2249 ****
  129.        guarantee a NULL at end of charset_name_array.  */
  130.   
  131.     if (optind + 1 > argc)
  132. !     usage (EXIT_FAILURE);
  133.   
  134.     decode_before_after (argv[optind++]);
  135.   
  136. --- 2256,2262 ----
  137.        guarantee a NULL at end of charset_name_array.  */
  138.   
  139.     if (optind + 1 > argc)
  140. !     usage (EXIT_SUCCESS);
  141.   
  142.     decode_before_after (argv[optind++]);
  143.   
  144. ***************
  145. *** 2317,2328 ****
  146.           strcpy (output_name, input_name);
  147.           for (cursor = output_name + strlen (output_name);
  148.            cursor > output_name && cursor[-1] != '/'
  149. ! #ifdef MSDOS
  150. !          /* It has been reported this next line is also required
  151. !             for OS/2 EMX.  */
  152.            && cursor[-1] != '\\' && cursor[-1] != ':'
  153.   #endif
  154. -          && cursor[-1] != '\\' && cursor[-1] != ':'
  155.            ; cursor--)
  156.             ;
  157.           strcpy (cursor, "recodeXX.TMP");
  158. --- 2330,2338 ----
  159.           strcpy (output_name, input_name);
  160.           for (cursor = output_name + strlen (output_name);
  161.            cursor > output_name && cursor[-1] != '/'
  162. ! #if defined(MSDOS) || defined(OS2)
  163.            && cursor[-1] != '\\' && cursor[-1] != ':'
  164.   #endif
  165.            ; cursor--)
  166.             ;
  167.           strcpy (cursor, "recodeXX.TMP");
  168.