diff options
author | bapt <bapt@FreeBSD.org> | 2017-04-11 16:32:46 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2017-04-11 16:32:46 +0000 |
commit | faf2f8fd2b957b5f91ad4e0fc8d0d1286da85829 (patch) | |
tree | c648b08b9cf0ca2f61a70f1349349e9f6383a424 | |
parent | c40ecee7e16cfb52700e6d9f02b70e0e241c39f4 (diff) | |
download | FreeBSD-src-faf2f8fd2b957b5f91ad4e0fc8d0d1286da85829.zip FreeBSD-src-faf2f8fd2b957b5f91ad4e0fc8d0d1286da85829.tar.gz |
MFC r316637-r316638
r316637:
When passingthrough from sdiff to diff the -H/--speed-large-files
options rename it to the long version as GNU diff only support the long
version of the option not the short version
r316638:
Remove a useless loop over the long options before passing through some
options to diff(1)
-rw-r--r-- | usr.bin/sdiff/sdiff.1 | 4 | ||||
-rw-r--r-- | usr.bin/sdiff/sdiff.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/sdiff/sdiff.1 b/usr.bin/sdiff/sdiff.1 index ef1e128..e15ae7e 100644 --- a/usr.bin/sdiff/sdiff.1 +++ b/usr.bin/sdiff/sdiff.1 @@ -4,7 +4,7 @@ .\" Written by Raymond Lai <ray@cyth.net>. .\" Public domain. .\" -.Dd $Mdocdate: July 5 2012 $ +.Dd April 8, 2017 .Dt SDIFF 1 .Os .Sh NAME @@ -12,7 +12,7 @@ .Nd side-by-side diff .Sh SYNOPSIS .Nm -.Op Fl abdilstW +.Op Fl abdilstHW .Op Fl I Ar regexp .Op Fl o Ar outfile .Op Fl w Ar width diff --git a/usr.bin/sdiff/sdiff.c b/usr.bin/sdiff/sdiff.c index 5a8c8b2..8a336b5 100644 --- a/usr.bin/sdiff/sdiff.c +++ b/usr.bin/sdiff/sdiff.c @@ -214,7 +214,6 @@ main(int argc, char **argv) int ch, fd[2] = {-1}, status; pid_t pid=0; const char *outfile = NULL; - struct option *popt; char **diffargv, *diffprog = DIFF_PATH, *filename1, *filename2, *tmp1, *tmp2, *s1, *s2; int i; @@ -260,9 +259,7 @@ main(int argc, char **argv) case 'E': case 'i': case 't': - case 'H': case 'W': - for(popt = longopts; ch != popt->val && popt->name != NULL; popt++); diffargv[1] = realloc(diffargv[1], sizeof(char) * strlen(diffargv[1]) + 2); /* * In diff, the 'W' option is 'w' and the 'w' is 'W'. @@ -272,6 +269,9 @@ main(int argc, char **argv) else sprintf(diffargv[1], "%s%c", diffargv[1], ch); break; + case 'H': + diffargv[diffargc++] = "--speed-large-files"; + break; case DIFFPROG_OPT: diffargv[0] = diffprog = optarg; break; @@ -1152,7 +1152,7 @@ usage(void) { fprintf(stderr, - "usage: sdiff [-abdilstW] [-I regexp] [-o outfile] [-w width] file1" + "usage: sdiff [-abdilstHW] [-I regexp] [-o outfile] [-w width] file1" " file2\n"); exit(2); } |