summaryrefslogtreecommitdiffstats
path: root/usr.bin/cmp/cmp.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-05-15 08:30:43 +0000
committerphk <phk@FreeBSD.org>2000-05-15 08:30:43 +0000
commitd529a5a010ba9d7f59c6b4e22c4aaaf15746eee5 (patch)
tree5f99705a5e9100446e6d3f90a7e9ce71a5a6f9ae /usr.bin/cmp/cmp.c
parentffd6fec6c030f09835e7ec783cde167b41d51cd0 (diff)
downloadFreeBSD-src-d529a5a010ba9d7f59c6b4e22c4aaaf15746eee5.zip
FreeBSD-src-d529a5a010ba9d7f59c6b4e22c4aaaf15746eee5.tar.gz
Let cmp(1) grow in -x option to print differences in contemporarry hex
format rather than the mixed decimal/octal format of -l.
Diffstat (limited to 'usr.bin/cmp/cmp.c')
-rw-r--r--usr.bin/cmp/cmp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c
index a4f4d88..2e1d798 100644
--- a/usr.bin/cmp/cmp.c
+++ b/usr.bin/cmp/cmp.c
@@ -29,6 +29,9 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
*/
#ifndef lint
@@ -53,7 +56,7 @@ static const char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/94";
#include "extern.h"
-int lflag, sflag;
+int lflag, sflag, xflag;
static void usage __P((void));
@@ -67,7 +70,7 @@ main(argc, argv)
int ch, fd1, fd2, special;
char *file1, *file2;
- while ((ch = getopt(argc, argv, "-ls")) != -1)
+ while ((ch = getopt(argc, argv, "-lsx")) != -1)
switch (ch) {
case 'l': /* print all differences */
lflag = 1;
@@ -75,6 +78,10 @@ main(argc, argv)
case 's': /* silent run */
sflag = 1;
break;
+ case 'x': /* hex output */
+ lflag = 1;
+ xflag = 1;
+ break;
case '-': /* stdin (must be after options) */
--optind;
goto endargs;
OpenPOWER on IntegriCloud