diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-06-27 20:28:14 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-06-27 20:28:14 +0000 |
commit | 8ca9fcb59914c26dd22d90927b34818d27afa9e3 (patch) | |
tree | 72509167fed3f2fec91c8a3ac92350c308be686a | |
parent | d714625c9319f21bad27b2bee4265317717892ba (diff) |
-a to force ascii compare. ok millert
-rw-r--r-- | usr.bin/diff/diff.1 | 14 | ||||
-rw-r--r-- | usr.bin/diff/diffdir.c | 5 | ||||
-rw-r--r-- | usr.bin/diff/diffreg.c | 5 |
3 files changed, 16 insertions, 8 deletions
diff --git a/usr.bin/diff/diff.1 b/usr.bin/diff/diff.1 index 481cbd7a81d..317130d7d75 100644 --- a/usr.bin/diff/diff.1 +++ b/usr.bin/diff/diff.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: diff.1,v 1.6 2003/06/26 04:53:02 millert Exp $ +.\" $OpenBSD: diff.1,v 1.7 2003/06/27 20:28:13 tedu Exp $ .\" .\" Copyright (c) 1980, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -37,26 +37,26 @@ .Nd differential file and directory comparator .Sh SYNOPSIS .Nm diff -.Op Fl bitw +.Op Fl abitw .Oo .Fl c | Fl e | Fl f | .Fl h | Fl n | Fl u .Oc .Ar file1 file2 .Nm diff -.Op Fl bitw +.Op Fl abitw .Op Fl C Ar number .Ar file1 file2 .Nm diff -.Op Fl bitw +.Op Fl abitw .Op Fl D Ar string .Ar file1 file2 .Nm diff -.Op Fl bitw +.Op Fl abitw .Op Fl U Ar number .Ar file1 file2 .Nm diff -.Op Fl bitw +.Op Fl abitw .Oo .Fl c | Fl e | Fl f | .Fl h | Fl n | Fl u @@ -79,6 +79,8 @@ No output is produced if the files are identical. .Pp Output options (mutually exclusive): .Bl -tag -width Ds +.It Fl a +Treat all files as ascii. .It Fl c Produces a diff with 3 lines of context. With diff --git a/usr.bin/diff/diffdir.c b/usr.bin/diff/diffdir.c index 1ba5117482a..d25d4d48491 100644 --- a/usr.bin/diff/diffdir.c +++ b/usr.bin/diff/diffdir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diffdir.c,v 1.14 2003/06/26 18:19:29 millert Exp $ */ +/* $OpenBSD: diffdir.c,v 1.15 2003/06/27 20:28:13 tedu Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -423,6 +423,9 @@ ascii(int f) char buf[BUFSIZ], *cp; int cnt; + if (aflag) + return (1); + lseek(f, (off_t)0, SEEK_SET); cnt = read(f, buf, BUFSIZ); cp = buf; diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index be2e9bfe466..e21bd4a3773 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diffreg.c,v 1.22 2003/06/26 22:04:45 millert Exp $ */ +/* $OpenBSD: diffreg.c,v 1.23 2003/06/27 20:28:13 tedu Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -992,6 +992,9 @@ asciifile(FILE *f) char buf[BUFSIZ], *cp; int cnt; + if (aflag) + return (1); + fseek(f, 0L, SEEK_SET); cnt = fread(buf, 1, BUFSIZ, f); cp = buf; |