From owner-dev-commits-src-all@freebsd.org Wed Jan 27 11:18:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFC584F5887; Wed, 27 Jan 2021 11:18:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DQh1n6zXhz3pL3; Wed, 27 Jan 2021 11:18:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE0DD1BC97; Wed, 27 Jan 2021 11:18:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10RBIrtc083702; Wed, 27 Jan 2021 11:18:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10RBIr26083701; Wed, 27 Jan 2021 11:18:53 GMT (envelope-from git) Date: Wed, 27 Jan 2021 11:18:53 GMT Message-Id: <202101271118.10RBIr26083701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 15abb2328654 - main - diff: eliminate space at end of line MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 15abb23286541c17ff95bac056cd4979822c4288 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2021 11:18:55 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=15abb23286541c17ff95bac056cd4979822c4288 commit 15abb23286541c17ff95bac056cd4979822c4288 Author: Baptiste Daroussin AuthorDate: 2021-01-27 10:46:15 +0000 Commit: Baptiste Daroussin CommitDate: 2021-01-27 11:18:45 +0000 diff: eliminate space at end of line No functionnal changes --- usr.bin/diff/diffreg.c | 66 +++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index a8d668ea0984..282db0f9c447 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -268,17 +268,17 @@ diffreg(char *file1, char *file2, int flags, int capsicum) lastmatchline = 0; context_vec_ptr = context_vec_start - 1; - /* - * hw excludes padding and make sure when -t is not used, + /* + * hw excludes padding and make sure when -t is not used, * the second column always starts from the closest tab stop */ - if (diff_format == D_SIDEBYSIDE) { + if (diff_format == D_SIDEBYSIDE) { hw = width >> 1; padding = tabsize - (hw % tabsize); if ((flags & D_EXPANDTABS) != 0 || (padding % tabsize == 0)) padding = MIN_PAD; - hw = (width >> 1) - + hw = (width >> 1) - ((padding == MIN_PAD) ? (padding << 1) : padding) - 1; } @@ -901,14 +901,14 @@ output(char *file1, FILE *f1, char *file2, FILE *f2, int flags) if (diff_format != D_EDIT) { for (i0 = 1; i0 <= m; i0 = i1 + 1) { while (i0 <= m && J[i0] == J[i0 - 1] + 1){ - if (diff_format == D_SIDEBYSIDE && + if (diff_format == D_SIDEBYSIDE && suppress_common != 1) { - nc = fetch(ixold, i0, i0, f1, '\0', + nc = fetch(ixold, i0, i0, f1, '\0', 1, flags); - print_space(nc, - (hw - nc) + (padding << 1) + 1, + print_space(nc, + (hw - nc) + (padding << 1) + 1, flags); - fetch(ixnew, J[i0], J[i0], f2, '\0', + fetch(ixnew, J[i0], J[i0], f2, '\0', 0, flags); diff_output("\n"); } @@ -922,32 +922,32 @@ output(char *file1, FILE *f1, char *file2, FILE *f2, int flags) J[i1] = j1; /* - * When using side-by-side, lines from both of the - * files are printed. The algorithm used by diff(1) - * identifies the ranges in which two files differ. - * See the change() function below. - * The for loop below consumes the shorter range, - * whereas one of the while loops deals with the + * When using side-by-side, lines from both of the + * files are printed. The algorithm used by diff(1) + * identifies the ranges in which two files differ. + * See the change() function below. + * The for loop below consumes the shorter range, + * whereas one of the while loops deals with the * longer one. */ if (diff_format == D_SIDEBYSIDE) { - for (i=i0, j=j0; i<=i1 && j<=j1; i++, j++) - change(file1, f1, file2, f2, i, i, + for (i=i0, j=j0; i<=i1 && j<=j1; i++, j++) + change(file1, f1, file2, f2, i, i, j, j, &flags); while (i <= i1) { - change(file1, f1, file2, f2, + change(file1, f1, file2, f2, i, i, j+1, j, &flags); i++; } while (j <= j1) { - change(file1, f1, file2, f2, + change(file1, f1, file2, f2, i+1, i, j, j, &flags); j++; } } else - change(file1, f1, file2, f2, i0, i1, j0, + change(file1, f1, file2, f2, i0, i1, j0, j1, &flags); } } else { @@ -1187,10 +1187,10 @@ proceed: print_space(0, hw + padding , *pflags); } else { nc = fetch(ixold, a, b, f1, '\0', 1, *pflags); - print_space(nc, hw - nc + padding, *pflags); + print_space(nc, hw - nc + padding, *pflags); } diff_output("%c", (a>b)? '>' : ((c>d)? '<' : '|')); - print_space(hw + padding + 1 , padding, *pflags); + print_space(hw + padding + 1 , padding, *pflags); fetch(ixnew, c, d, f2, '\0', 0, *pflags); diff_output("\n"); } @@ -1259,13 +1259,13 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) for (i = a; i <= b; i++) { fseek(lb, f[i - 1], SEEK_SET); nc = (f[i] - f[i - 1]); - if (diff_format == D_SIDEBYSIDE && hw < nc) + if (diff_format == D_SIDEBYSIDE && hw < nc) nc = hw; - if ((diff_format != D_IFDEF && diff_format != D_GFORMAT) && + if ((diff_format != D_IFDEF && diff_format != D_GFORMAT) && ch != '\0') { diff_output("%c", ch); - if (Tflag && (diff_format == D_NORMAL || - diff_format == D_CONTEXT || + if (Tflag && (diff_format == D_NORMAL || + diff_format == D_CONTEXT || diff_format == D_UNIFIED)) diff_output("\t"); else if (diff_format != D_UNIFIED) @@ -1274,7 +1274,7 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) col = 0; for (j = 0, lastc = '\0'; j < nc; j++, lastc = c) { if ((c = getc(lb)) == EOF) { - if (diff_format == D_EDIT || + if (diff_format == D_EDIT || diff_format == D_REVERSE || diff_format == D_NREVERSE) warnx("No newline at end of file"); @@ -1283,8 +1283,8 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) "file\n"); return col; } - /* - * when using --side-by-side, col needs to be increased + /* + * when using --side-by-side, col needs to be increased * in any case to keep the columns aligned */ if (c == '\t') { @@ -1296,9 +1296,9 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) diff_output(" "); } while (++col < newcol && j < nc); } else { - if (diff_format == D_SIDEBYSIDE) { + if (diff_format == D_SIDEBYSIDE) { if ((j + tabsize) > nc) { - diff_output("%*s", + diff_output("%*s", nc - j,""); j = col = nc; } else { @@ -1690,9 +1690,9 @@ print_header(const char *file1, const char *file2) file2, buf2); } -/* +/* * Prints n number of space characters either by using tab - * or single space characters. + * or single space characters. * nc is the preceding number of characters */ static void