aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/diff/diff.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2017-06-02 03:25:59 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2017-06-02 03:25:59 +0000
commitea67c7a015806b1435c5eb106204e31e323b14f3 (patch)
tree512e9f60c7c40ef88e4b0dc5ad5b1445f3e819ae /usr.bin/diff/diff.c
parent13eb5b4943f93a10ea79990fb093a9c6bf80e27f (diff)
downloadsrc-ea67c7a015806b1435c5eb106204e31e323b14f3.tar.gz
src-ea67c7a015806b1435c5eb106204e31e323b14f3.zip
Add -H as an alias for --speed-large-file to match GNU diff.
This is undocumented to match GNU diff where -H is also undocumented. Some existing software (such as kompare) uses this option by default. Reviewed by: emaste, rpokala Differential Revision: https://reviews.freebsd.org/D11022
Notes
Notes: svn path=/head/; revision=319489
Diffstat (limited to 'usr.bin/diff/diff.c')
-rw-r--r--usr.bin/diff/diff.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c
index f314e9f76c3f..e12697c4e89e 100644
--- a/usr.bin/diff/diff.c
+++ b/usr.bin/diff/diff.c
@@ -46,7 +46,7 @@ struct stat stb1, stb2;
struct excludes *excludes_list;
regex_t ignore_re;
-#define OPTIONS "0123456789aBbC:cdD:efhI:iL:lnNPpqrS:sTtU:uwX:x:"
+#define OPTIONS "0123456789aBbC:cdD:efHhI:iL:lnNPpqrS:sTtU:uwX:x:"
enum {
OPT_TSIZE = CHAR_MAX + 1,
OPT_STRIPCR,
@@ -54,7 +54,6 @@ enum {
OPT_NO_IGN_FN_CASE,
OPT_NORMAL,
OPT_HORIZON_LINES,
- OPT_SPEED_LARGE_FILES,
OPT_CHANGED_GROUP_FORMAT,
};
@@ -66,6 +65,7 @@ static struct option longopts[] = {
{ "minimal", no_argument, 0, 'd' },
{ "ed", no_argument, 0, 'e' },
{ "forward-ed", no_argument, 0, 'f' },
+ { "speed-large-files", no_argument, NULL, 'H' },
{ "ignore-matching-lines", required_argument, 0, 'I' },
{ "ignore-case", no_argument, 0, 'i' },
{ "paginate", no_argument, NULL, 'l' },
@@ -88,7 +88,6 @@ static struct option longopts[] = {
{ "horizon-lines", required_argument, NULL, OPT_HORIZON_LINES },
{ "no-ignore-file-name-case", no_argument, NULL, OPT_NO_IGN_FN_CASE },
{ "normal", no_argument, NULL, OPT_NORMAL },
- { "speed-large-files", no_argument, NULL, OPT_SPEED_LARGE_FILES},
{ "strip-trailing-cr", no_argument, NULL, OPT_STRIPCR },
{ "tabsize", optional_argument, NULL, OPT_TSIZE },
{ "changed-group-format", required_argument, NULL, OPT_CHANGED_GROUP_FORMAT},
@@ -159,6 +158,9 @@ main(int argc, char **argv)
case 'f':
diff_format = D_REVERSE;
break;
+ case 'H':
+ /* ignore but needed for compatibility with GNU diff */
+ break;
case 'h':
/* silently ignore for backwards compatibility */
break;
@@ -252,8 +254,6 @@ main(int argc, char **argv)
usage();
}
break;
- case OPT_SPEED_LARGE_FILES:
- break; /* ignore but needed for compatibility with GNU diff */
case OPT_STRIPCR:
dflags |= D_STRIPCR;
break;