socsvn commit: r237577 - in soc2012/jhagewood/diff3: . diff3

jhagewood at FreeBSD.org jhagewood at FreeBSD.org
Wed Jun 13 03:04:38 UTC 2012


Author: jhagewood
Date: Wed Jun 13 03:04:35 2012
New Revision: 237577
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237577

Log:

Modified:
  soc2012/jhagewood/diff3/diff3/diff3prog.c
  soc2012/jhagewood/diff3/hagewood-diff3.patch

Modified: soc2012/jhagewood/diff3/diff3/diff3prog.c
==============================================================================
--- soc2012/jhagewood/diff3/diff3/diff3prog.c	Wed Jun 13 03:00:08 2012	(r237576)
+++ soc2012/jhagewood/diff3/diff3/diff3prog.c	Wed Jun 13 03:04:35 2012	(r237577)
@@ -488,7 +488,6 @@
 
 	if (aflag || f == NULL)
 		return(1);
-
 	rewind(f);
 	errno = 0;
 	for (i = 0; i <= BUFSIZ; i++) {
@@ -766,6 +765,6 @@
 usage(void)
 {
 	
-	fprintf(stderr, "usage: diff3 [-exEX3] file1 file2 file3\n");
+	fprintf(stderr, "usage: diff3 %s file1 file2 file3\n", OPTIONS);
 	exit(EXIT_FAILURE);
 }

Modified: soc2012/jhagewood/diff3/hagewood-diff3.patch
==============================================================================
--- soc2012/jhagewood/diff3/hagewood-diff3.patch	Wed Jun 13 03:00:08 2012	(r237576)
+++ soc2012/jhagewood/diff3/hagewood-diff3.patch	Wed Jun 13 03:04:35 2012	(r237577)
@@ -11,7 +11,7 @@
  .include <bsd.prog.mk>
 diff -rupN jhagewood/diff3/diff3-orig/diff3prog.c jhagewood/diff3/diff3/diff3prog.c
 --- jhagewood/diff3/diff3-orig/diff3prog.c	2012-06-10 03:31:05.000000000 -0400
-+++ jhagewood/diff3/diff3/diff3prog.c	2012-06-13 02:59:50.000000000 -0400
++++ jhagewood/diff3/diff3/diff3prog.c	2012-06-13 03:04:14.000000000 -0400
 @@ -64,22 +64,31 @@
   *	@(#)diff3.c	8.1 (Berkeley) 6/6/93
   */
@@ -25,7 +25,7 @@
  #endif
 +#endif /* not lint */
 +#include <sys/cdefs.h>
-+__FBSDID("$FreeBSD: soc2012/jhagewood/diff3/diff3/diff3prog.c 237524 2012-06-12 01:22:49Z jhagewood $");
++__FBSDID("$FreeBSD: soc2012/jhagewood/diff3/diff3/diff3prog.c 237576 2012-06-13 03:00:08Z jhagewood $");
  
 +#include <ctype.h>
 +#include <err.h>
@@ -214,19 +214,17 @@
  		printf("Binary file detected; comparison failed\n");
  		exit(EXIT_FAILURE);
  	}
-@@ -466,29 +483,30 @@ merge(int m1, int m2)
+@@ -466,29 +483,29 @@ merge(int m1, int m2)
  static int
  asciifile(FILE *f)
  {
 -        wint_t   ch = L'\0';
 -        size_t   i;
-+	wint_t   ch = L'\0';
-+	size_t   i;
- 
+-
 -        if (aflag || f == NULL)
 -                return (1);
-+	if (aflag || f == NULL)
-+		return(1);
++	wint_t   ch = L'\0';
++	size_t   i;
  
 -        rewind(f);
 -        errno = 0;
@@ -240,6 +238,8 @@
 -                        return (0);
 -        }
 -        return (1);
++	if (aflag || f == NULL)
++		return(1);
 +	rewind(f);
 +	errno = 0;
 +	for (i = 0; i <= BUFSIZ; i++) {
@@ -261,7 +261,7 @@
  	printf("====%s\n", s);
  }
  
-@@ -500,6 +518,7 @@ separate(const char *s)
+@@ -500,6 +517,7 @@ separate(const char *s)
  void
  change(int i, struct range *rold, int dup)
  {
@@ -269,7 +269,7 @@
  	printf("%d:", i);
  	last[i] = rold->to;
  	prange(rold);
-@@ -510,12 +529,14 @@ change(int i, struct range *rold, int du
+@@ -510,12 +528,14 @@ change(int i, struct range *rold, int du
  	(void)skip(i, rold->to, "  ");
  }
  
@@ -286,7 +286,7 @@
  	if (rold->to <= rold->from)
  		printf("%da\n", rold->from - 1);
  	else {
-@@ -558,10 +579,9 @@ skip(int i, int from, char *pr)
+@@ -558,10 +578,9 @@ skip(int i, int from, char *pr)
  			trouble();
  		if (pr != NULL)
  			printf("%s%s", Tflag == 1? "\t" : pr, line);
@@ -298,7 +298,7 @@
  }
  
  /*
-@@ -576,7 +596,7 @@ duplicate(struct range *r1, struct range
+@@ -576,7 +595,7 @@ duplicate(struct range *r1, struct range
  	int nline;
  
  	if (r1->to-r1->from != r2->to-r2->from)
@@ -307,7 +307,7 @@
  	(void)skip(0, r1->from, NULL);
  	(void)skip(1, r2->from, NULL);
  	nchar = 0;
-@@ -589,12 +609,12 @@ duplicate(struct range *r1, struct range
+@@ -589,12 +608,12 @@ duplicate(struct range *r1, struct range
  			nchar++;
  			if (c != d) {
  				repos(nchar);
@@ -322,7 +322,7 @@
  }
  
  void
-@@ -606,9 +626,33 @@ repos(int nchar)
+@@ -606,9 +625,33 @@ repos(int nchar)
  		(void)fseek(fp[i], (long)-nchar, SEEK_CUR);
  }
  
@@ -356,7 +356,7 @@
  	errx(EXIT_FAILURE, "logic error");
  }
  
-@@ -618,8 +662,9 @@ trouble(void)
+@@ -618,8 +661,9 @@ trouble(void)
  int
  edit(struct diff *diff, int dup, int j)
  {
@@ -367,7 +367,7 @@
  	j++;
  	overlap[j] = !dup;
  	if (!dup)
-@@ -628,7 +673,7 @@ edit(struct diff *diff, int dup, int j)
+@@ -628,7 +672,7 @@ edit(struct diff *diff, int dup, int j)
  	de[j].old.to = diff->old.to;
  	de[j].new.from = de[j-1].new.to + skip(2, diff->new.from, NULL);
  	de[j].new.to = de[j].new.from + skip(2, diff->new.to, NULL);
@@ -376,7 +376,7 @@
  }
  
  /* regurgitate */
-@@ -657,7 +702,6 @@ edscript(int n)
+@@ -657,7 +701,6 @@ edscript(int n)
  			printf("%da\n%s\n.\n", de[n].old.from - 1, f1mark);
  		}
  	}
@@ -384,7 +384,7 @@
  	if( iflag )
  		printf("w\nq\n");
  
-@@ -698,13 +742,30 @@ increase(void)
+@@ -698,13 +741,30 @@ increase(void)
  	szchanges = newsz;
  }
  
@@ -416,6 +416,6 @@
 -	fprintf(stderr, "usage: %s [-exEX3] /tmp/d3a.?????????? "
 -	    "/tmp/d3b.?????????? file1 file2 file3\n", __progname);
 +	
-+	fprintf(stderr, "usage: diff3 [-exEX3] file1 file2 file3\n");
++	fprintf(stderr, "usage: diff3 %s file1 file2 file3\n", OPTIONS);
  	exit(EXIT_FAILURE);
  }


More information about the svn-soc-all mailing list