home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / rcs57pc3.zip / diff16 / patches.bin < prev    next >
Text File  |  1996-02-29  |  2KB  |  66 lines

  1. Additional patches ported back from diff 2.7.2 to allow 1.15 to 
  2. support diffs of binary files. Needs new getopt for full command
  3. line compatibility as well.
  4.  
  5. *** diff.c~    Sat Jun 25 13:06:32 1994
  6. --- diff.c    Thu Feb 29 20:20:30 1996
  7. ***************
  8. *** 37,42 ****
  9. --- 37,45 ----
  10.   
  11.   int no_discards;
  12.   
  13. + /* I/O mode: nonzero only if using binary input/output.  */
  14. + static int binary_I_O;
  15.   /* Return a string containing the command options with which diff was invoked.
  16.      Spaces appear between what were separate ARGV-elements.
  17.      There is a space at the beginning but none at the end.
  18. ***************
  19. *** 98,104 ****
  20.     {"rcs", 0, 0, 'n'},
  21.     {"show-c-function", 0, 0, 'p'},
  22.     {"patch", 0, 0, 'P'},
  23. !   {"binary", 0, 0, 'q'},
  24.     {"brief", 0, 0, 'q'},
  25.     {"recursive", 0, 0, 'r'},
  26.     {"report-identical-files", 0, 0, 's'},
  27. --- 101,107 ----
  28.     {"rcs", 0, 0, 'n'},
  29.     {"show-c-function", 0, 0, 'p'},
  30.     {"patch", 0, 0, 'P'},
  31. !   {"binary", 0, 0, 142},
  32.     {"brief", 0, 0, 'q'},
  33.     {"recursive", 0, 0, 'r'},
  34.     {"report-identical-files", 0, 0, 's'},
  35. ***************
  36. *** 371,376 ****
  37. --- 374,386 ----
  38.         length_varies = 1;
  39.         break;
  40.   
  41. +     case 142:
  42. +       /* Use binary I/O when reading and writing data.
  43. +          On Posix hosts, this has no effect.  */
  44. +       binary_I_O = 1;
  45. +       setmode (1, O_BINARY);
  46. +       break;
  47.       default:
  48.         usage ();
  49.       }
  50. ***************
  51. *** 775,780 ****
  52. --- 785,795 ----
  53.       {
  54.   
  55.         /* Both exist and both are ordinary files.  */
  56. +       if (binary_I_O)
  57. +     for (i = 0; i <= 1; i++)
  58. +       if (0 <= inf[i].desc)
  59. +         setmode (inf[i].desc, O_BINARY);
  60.   
  61.         val = diff_2_files (inf, depth);
  62.   
  63.