home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 22 gnu
/
22-gnu.zip
/
rcs57pc3.zip
/
diff16
/
patches.bin
< prev
next >
Wrap
Text File
|
1996-02-29
|
2KB
|
66 lines
Additional patches ported back from diff 2.7.2 to allow 1.15 to
support diffs of binary files. Needs new getopt for full command
line compatibility as well.
*** diff.c~ Sat Jun 25 13:06:32 1994
--- diff.c Thu Feb 29 20:20:30 1996
***************
*** 37,42 ****
--- 37,45 ----
int no_discards;
+ /* I/O mode: nonzero only if using binary input/output. */
+ static int binary_I_O;
+
/* Return a string containing the command options with which diff was invoked.
Spaces appear between what were separate ARGV-elements.
There is a space at the beginning but none at the end.
***************
*** 98,104 ****
{"rcs", 0, 0, 'n'},
{"show-c-function", 0, 0, 'p'},
{"patch", 0, 0, 'P'},
! {"binary", 0, 0, 'q'},
{"brief", 0, 0, 'q'},
{"recursive", 0, 0, 'r'},
{"report-identical-files", 0, 0, 's'},
--- 101,107 ----
{"rcs", 0, 0, 'n'},
{"show-c-function", 0, 0, 'p'},
{"patch", 0, 0, 'P'},
! {"binary", 0, 0, 142},
{"brief", 0, 0, 'q'},
{"recursive", 0, 0, 'r'},
{"report-identical-files", 0, 0, 's'},
***************
*** 371,376 ****
--- 374,386 ----
length_varies = 1;
break;
+ case 142:
+ /* Use binary I/O when reading and writing data.
+ On Posix hosts, this has no effect. */
+ binary_I_O = 1;
+ setmode (1, O_BINARY);
+ break;
+
default:
usage ();
}
***************
*** 775,780 ****
--- 785,795 ----
{
/* Both exist and both are ordinary files. */
+
+ if (binary_I_O)
+ for (i = 0; i <= 1; i++)
+ if (0 <= inf[i].desc)
+ setmode (inf[i].desc, O_BINARY);
val = diff_2_files (inf, depth);