From owner-svn-soc-all@FreeBSD.ORG Tue Jun 19 03:09:43 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id DAA9A106566B for ; Tue, 19 Jun 2012 03:09:42 +0000 (UTC) (envelope-from jhagewood@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Tue, 19 Jun 2012 03:09:42 +0000 Date: Tue, 19 Jun 2012 03:09:42 +0000 From: jhagewood@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120619030942.DAA9A106566B@hub.freebsd.org> Cc: Subject: socsvn commit: r237920 - in soc2012/jhagewood/diff: . diff X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 03:09:44 -0000 Author: jhagewood Date: Tue Jun 19 03:09:41 2012 New Revision: 237920 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237920 Log: Modified: soc2012/jhagewood/diff/diff/diffreg.c soc2012/jhagewood/diff/hagewood-diff.patch Modified: soc2012/jhagewood/diff/diff/diffreg.c ============================================================================== --- soc2012/jhagewood/diff/diff/diffreg.c Tue Jun 19 02:54:54 2012 (r237919) +++ soc2012/jhagewood/diff/diff/diffreg.c Tue Jun 19 03:09:41 2012 (r237920) @@ -359,7 +359,6 @@ status |= 2; goto closem; } - switch (files_differ(f1, f2, flags)) { case 0: goto closem; @@ -754,14 +753,12 @@ static void check(char *file1, FILE *f1, char *file2, FILE *f2) { - int i, j, jackpot, c, d, spacetab; + int i, j, jackpot, c, d; long ctold, ctnew; - fpos_t position; rewind(f1); rewind(f2); j = 1; - spacetab = 1; ixold[0] = ixnew[0] = 0; jackpot = 0; ctold = ctnew = 0; @@ -829,33 +826,24 @@ } break; /* ignore-tab-expansion */ - } /*else if (Eflag) { - if (c == '\t' && d == ' ') { - fgetpos(f2, &position); - for (j = 1; j <= 7; j++) { - d = getc(f2); - if (d != " ") - spacetab = 0; - } - fsetpos(f2, &position); - if (spacetab) { - - } + } else if (Eflag) { + if (isspace(c) && isspace(d)) { + if (d == '\t') { + do { + if (c != ' ') + break; + ctold++; + } while (isspace(c = getc(f1))); } - if (d == '\t' && c == ' ') { - fgetpos(f1, &position); - for (j = 1; j <= 7; j++) { - c = getc(f2); - if (c != " ") - spacetab = 0; - } - fsetpos(f1, &position); - if (spacetab) { - - } + } + if (c == '\t') { + do { + if (d != ' ') + break; + ctnew++; + } while (isspace(d = getc(f2))); } - break; - } */ + } if (chrtran[c] != chrtran[d]) { jackpot++; J[i] = 0; Modified: soc2012/jhagewood/diff/hagewood-diff.patch ============================================================================== --- soc2012/jhagewood/diff/hagewood-diff.patch Tue Jun 19 02:54:54 2012 (r237919) +++ soc2012/jhagewood/diff/hagewood-diff.patch Tue Jun 19 03:09:41 2012 (r237920) @@ -123,7 +123,7 @@ extern int format, context, status; diff -rupN jhagewood/diff/diff-orig/diffreg.c jhagewood/diff/diff/diffreg.c --- jhagewood/diff/diff-orig/diffreg.c 2012-06-18 03:07:38.000000000 -0400 -+++ jhagewood/diff/diff/diffreg.c 2012-06-18 03:07:38.000000000 -0400 ++++ jhagewood/diff/diff/diffreg.c 2012-06-19 03:08:39.000000000 -0400 @@ -90,6 +90,12 @@ __FBSDID("$FreeBSD"); #include "diff.h" #include "pathnames.h" @@ -137,24 +137,26 @@ /* * diff - compare two files. */ -@@ -748,12 +754,14 @@ unravel(int p) +@@ -353,7 +359,6 @@ diffreg(char *ofile1, char *ofile2, int + status |= 2; + goto closem; + } +- + switch (files_differ(f1, f2, flags)) { + case 0: + goto closem; +@@ -748,8 +753,8 @@ unravel(int p) static void check(char *file1, FILE *f1, char *file2, FILE *f2) { - int i, j, jackpot, c, d; - long ctold, ctnew; -+ int i, j, jackpot, c, d, spacetab; ++ int i, j, jackpot, c, d; + long ctold, ctnew; -+ fpos_t position; rewind(f1); rewind(f2); - j = 1; -+ spacetab = 1; - ixold[0] = ixnew[0] = 0; - jackpot = 0; - ctold = ctnew = 0; -@@ -766,7 +774,7 @@ check(char *file1, FILE *f1, char *file2 +@@ -766,7 +771,7 @@ check(char *file1, FILE *f1, char *file2 ixnew[j] = ctnew += skipline(f2); j++; } @@ -163,7 +165,7 @@ for (;;) { c = getc(f1); d = getc(f2); -@@ -803,29 +811,51 @@ check(char *file1, FILE *f1, char *file2 +@@ -803,29 +808,42 @@ check(char *file1, FILE *f1, char *file2 } } else if (Bflag) { @@ -191,39 +193,29 @@ } - break; -- } + /* ignore-tab-expansion */ -+ } /*else if (Eflag) { -+ if (c == '\t' && d == ' ') { -+ fgetpos(f2, &position); -+ for (j = 1; j <= 7; j++) { -+ d = getc(f2); -+ if (d != " ") -+ spacetab = 0; -+ } -+ fsetpos(f2, &position); -+ if (spacetab) { -+ -+ } ++ } else if (Eflag) { ++ if (isspace(c) && isspace(d)) { ++ if (d == '\t') { ++ do { ++ if (c != ' ') ++ break; ++ ctold++; ++ } while (isspace(c = getc(f1))); + } -+ if (d == '\t' && c == ' ') { -+ fgetpos(f1, &position); -+ for (j = 1; j <= 7; j++) { -+ c = getc(f2); -+ if (c != " ") -+ spacetab = 0; -+ } -+ fsetpos(f1, &position); -+ if (spacetab) { -+ -+ } + } ++ if (c == '\t') { ++ do { ++ if (d != ' ') ++ break; ++ ctnew++; ++ } while (isspace(d = getc(f2))); + } -+ break; -+ } */ ++ } if (chrtran[c] != chrtran[d]) { jackpot++; J[i] = 0; -@@ -1551,16 +1581,43 @@ dump_unified_vec(FILE *f1, FILE *f2) +@@ -1551,16 +1569,43 @@ dump_unified_vec(FILE *f1, FILE *f2) static void print_header(const char *file1, const char *file2) {