Commit Graph

5 Commits

Author SHA1 Message Date
Conrad Meyer
a60711fd00 sdiff(1): Fix potential NULL deref in cleanup path
In the presence of the --diff-pid argument, it is possible for 'diffpipe' to be
NULL.  Only fclose() it if it was initialized.

Reported by:	Coverity
CID:		1355183
Sponsored by:	EMC / Isilon Storage Division
2016-05-10 20:09:40 +00:00
Baptiste Daroussin
0c4ac56e16 Replace fparseln(3) with getline(3)
It removes a dependency on libutil.
2016-05-07 18:21:58 +00:00
Bjoern A. Zeeb
e29c552990 fgetc returns an int not a char.
Found by:   powerpc builds failing due to comparing with EOF raised:
"comparison is always false due to limited range of data type"
2016-05-02 15:07:43 +00:00
Baptiste Daroussin
da5c2c4230 When checking for binary file, check if ch is not EOF only ch actually got
a value assigned

Reported by:	pfg
2016-04-30 14:48:30 +00:00
Baptiste Daroussin
13b5b54865 import sdiff(1) from GSoC 2012
Import sdiff(1) from the diff version written by Raymond Lai,
improved during GSoC 2012 by Jesse Hagewood.

Compared to the version done in during that summer of code:
- Remove the zlib frontend: zsdiff
- Compatible output (column size and separators) with GNU sdiff

Compared to GNU sdiff in ports:
- The only difference is padding using spaces vs tabs

Compared to OpenBSD and NetBSD import:
- Implement missing options (including long options) from GNU sdiff
- Improved support for the edition mode (signal handling)
- Output visually compatible with GNU sdiff: size of columns

While here import regression tests from NetBSD adapted to fit the output as
expected by GNU sdiff

Reviewed by:	emaste (in part)
Obtained from:	OpenBSD, NetBSD, GSoC 2012
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D5981
Differential Revision:	https://reviews.freebsd.org/D6032 (diff with NetBSD version)
Differential Revision:	https://reviews.freebsd.org/D6033 (diff with OpenBSD version)
2016-04-29 23:27:15 +00:00