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

jhagewood at FreeBSD.org jhagewood at FreeBSD.org
Wed Jun 13 19:37:44 UTC 2012


Author: jhagewood
Date: Wed Jun 13 19:37:41 2012
New Revision: 237623
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237623

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 18:57:27 2012	(r237622)
+++ soc2012/jhagewood/diff3/diff3/diff3prog.c	Wed Jun 13 19:37:41 2012	(r237623)
@@ -165,9 +165,9 @@
 __dead void usage(void);
 
 enum {  
-    HELP_OPT = CHAR_MAX + 1,
-    STRIPCR_OPT,
-	DIFFPROG_OPT,
+        HELP_OPT = CHAR_MAX + 1,
+        STRIPCR_OPT,
+        DIFFPROG_OPT,
 };
 
 #define OPTIONS "3aAeEiL:mTvxX"
@@ -321,7 +321,7 @@
 		(*dd)[i].new.from = (*dd)[i-1].new.to;
 	}
 	(void)fclose(fp[0]);
-	return(i);
+	return (i);
 }
 
 int
@@ -332,7 +332,7 @@
 	nn = 0;
 	while (isdigit((unsigned char)(**lc)))
 		nn = nn*10 + *(*lc)++ - '0';
-	return(nn);
+	return (nn);
 }
 
 char *
@@ -342,9 +342,9 @@
 
 	while ((line = getline(b, NULL))) {
 		if (isdigit((unsigned char)line[0]))
-			return(line);
+			return (line);
 	}
-	return(NULL);
+	return (NULL);
 }
 
 char *
@@ -356,7 +356,7 @@
 	static size_t bufsize;
 
 	if ((cp = fgetln(b, &len)) == NULL)
-		return(NULL);
+		return (NULL);
 
 	if (cp[len - 1] != '\n')
 		len++;
@@ -372,7 +372,7 @@
 	buf[len] = '\0';
 	if (n != NULL)
 		*n = len;
-	return(buf);
+	return (buf);
 }
 
 void
@@ -487,19 +487,19 @@
 	size_t i;
 
 	if (aflag || f == NULL)
-		return(1);
+		return (1);
 	rewind(f);
 	errno = 0;
 	for (i = 0; i <= BUFSIZ; i++) {
 		if ((ch = fgetwc(f)) == WEOF) {
 			if (errno == EILSEQ)
-				return(0);
+				return (0);
 			break;
 		}
 		if (!iswspace(ch) && iswcntrl(ch))
-			return(0);
+			return (0);
 	}
-	return(1);
+	return (1);
 }
 
 void
@@ -580,7 +580,7 @@
 			printf("%s%s", Tflag == 1? "\t" : pr, line);
 		cline[i]++;
 	}
-	return((int) n);
+	return ((int) n);
 }
 
 /*
@@ -595,7 +595,7 @@
 	int nline;
 
 	if (r1->to-r1->from != r2->to-r2->from)
-		return(0);
+		return (0);
 	(void)skip(0, r1->from, NULL);
 	(void)skip(1, r2->from, NULL);
 	nchar = 0;
@@ -608,12 +608,12 @@
 			nchar++;
 			if (c != d) {
 				repos(nchar);
-				return(0);
+				return (0);
 			}
 		} while (c != '\n');
 	}
 	repos(nchar);
-	return(1);
+	return (1);
 }
 
 void
@@ -663,7 +663,7 @@
 {
 	
 	if (((dup + 1) & eflag) == 0)
-		return(j);
+		return (j);
 	j++;
 	overlap[j] = !dup;
 	if (!dup)
@@ -672,7 +672,7 @@
 	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);
-	return(j);
+	return (j);
 }
 
 /* regurgitate */
@@ -701,7 +701,7 @@
 			printf("%da\n%s\n.\n", de[n].old.from - 1, f1mark);
 		}
 	}
-	if( iflag )
+	if (iflag)
 		printf("w\nq\n");
 
 	exit(overlapcnt);

Modified: soc2012/jhagewood/diff3/hagewood-diff3.patch
==============================================================================
--- soc2012/jhagewood/diff3/hagewood-diff3.patch	Wed Jun 13 18:57:27 2012	(r237622)
+++ soc2012/jhagewood/diff3/hagewood-diff3.patch	Wed Jun 13 19:37:41 2012	(r237623)
@@ -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 03:11:59.000000000 -0400
++++ jhagewood/diff3/diff3/diff3prog.c	2012-06-13 19:37:26.000000000 -0400
 @@ -64,22 +64,31 @@
   *	@(#)diff3.c	8.1 (Berkeley) 6/6/93
   */
@@ -62,11 +62,10 @@
  __dead void usage(void);
  
  enum {  
--        HELP_OPT = CHAR_MAX + 1,
--        STRIPCR_OPT,
-+    HELP_OPT = CHAR_MAX + 1,
-+    STRIPCR_OPT,
- 	DIFFPROG_OPT,
+         HELP_OPT = CHAR_MAX + 1,
+         STRIPCR_OPT,
+-	DIFFPROG_OPT,
++        DIFFPROG_OPT,
  };
  
  #define OPTIONS "3aAeEiL:mTvxX"
@@ -153,15 +152,7 @@
  	}
  	merge(m, n);
  	exit(EXIT_SUCCESS);
-@@ -304,17 +321,18 @@ readin(char *name, struct diff **dd)
- 		(*dd)[i].new.from = (*dd)[i-1].new.to;
- 	}
- 	(void)fclose(fp[0]);
--	return (i);
-+	return(i);
- }
- 
- int
+@@ -311,6 +328,7 @@ int
  number(char **lc)
  {
  	int nn;
@@ -169,41 +160,6 @@
  	nn = 0;
  	while (isdigit((unsigned char)(**lc)))
  		nn = nn*10 + *(*lc)++ - '0';
--	return (nn);
-+	return(nn);
- }
- 
- char *
-@@ -324,9 +342,9 @@ getchange(FILE *b)
- 
- 	while ((line = getline(b, NULL))) {
- 		if (isdigit((unsigned char)line[0]))
--			return (line);
-+			return(line);
- 	}
--	return (NULL);
-+	return(NULL);
- }
- 
- char *
-@@ -338,7 +356,7 @@ getline(FILE *b, size_t *n)
- 	static size_t bufsize;
- 
- 	if ((cp = fgetln(b, &len)) == NULL)
--		return (NULL);
-+		return(NULL);
- 
- 	if (cp[len - 1] != '\n')
- 		len++;
-@@ -354,7 +372,7 @@ getline(FILE *b, size_t *n)
- 	buf[len] = '\0';
- 	if (n != NULL)
- 		*n = len;
--	return (buf);
-+	return(buf);
- }
- 
- void
 @@ -367,8 +385,7 @@ merge(int m1, int m2)
  	d2 = d23;
  	j = 0;
@@ -220,12 +176,12 @@
  {
 -        wint_t   ch = L'\0';
 -        size_t   i;
--
--        if (aflag || f == NULL)
--                return (1);
 +	wint_t ch = L'\0';
 +	size_t i;
  
+-        if (aflag || f == NULL)
+-                return (1);
+-
 -        rewind(f);
 -        errno = 0;
 -        for (i = 0; i <= BUFSIZ; i++) {
@@ -239,19 +195,19 @@
 -        }
 -        return (1);
 +	if (aflag || f == NULL)
-+		return(1);
++		return (1);
 +	rewind(f);
 +	errno = 0;
 +	for (i = 0; i <= BUFSIZ; i++) {
 +		if ((ch = fgetwc(f)) == WEOF) {
 +			if (errno == EILSEQ)
-+				return(0);
++				return (0);
 +			break;
 +		}
 +		if (!iswspace(ch) && iswcntrl(ch))
-+			return(0);
++			return (0);
 +	}
-+	return(1);
++	return (1);
  }
  
  void
@@ -286,19 +242,15 @@
  	if (rold->to <= rold->from)
  		printf("%da\n", rold->from - 1);
  	else {
-@@ -558,10 +578,9 @@ skip(int i, int from, char *pr)
+@@ -558,7 +578,6 @@ skip(int i, int from, char *pr)
  			trouble();
  		if (pr != NULL)
  			printf("%s%s", Tflag == 1? "\t" : pr, line);
 -
  		cline[i]++;
  	}
--	return ((int) n);
-+	return((int) n);
- }
- 
- /*
-@@ -571,12 +590,12 @@ skip(int i, int from, char *pr)
+ 	return ((int) n);
+@@ -571,7 +590,7 @@ skip(int i, int from, char *pr)
  int
  duplicate(struct range *r1, struct range *r2)
  {
@@ -307,27 +259,6 @@
  	int nchar;
  	int nline;
  
- 	if (r1->to-r1->from != r2->to-r2->from)
--		return (0);
-+		return(0);
- 	(void)skip(0, r1->from, NULL);
- 	(void)skip(1, r2->from, NULL);
- 	nchar = 0;
-@@ -589,12 +608,12 @@ duplicate(struct range *r1, struct range
- 			nchar++;
- 			if (c != d) {
- 				repos(nchar);
--				return (0);
-+				return(0);
- 			}
- 		} while (c != '\n');
- 	}
- 	repos(nchar);
--	return (1);
-+	return(1);
- }
- 
- void
 @@ -606,9 +625,33 @@ repos(int nchar)
  		(void)fseek(fp[i], (long)-nchar, SEEK_CUR);
  }
@@ -362,26 +293,15 @@
  	errx(EXIT_FAILURE, "logic error");
  }
  
-@@ -618,8 +661,9 @@ trouble(void)
+@@ -618,6 +661,7 @@ trouble(void)
  int
  edit(struct diff *diff, int dup, int j)
  {
 +	
  	if (((dup + 1) & eflag) == 0)
--		return (j);
-+		return(j);
+ 		return (j);
  	j++;
- 	overlap[j] = !dup;
- 	if (!dup)
-@@ -628,14 +672,14 @@ 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);
--	return (j);
-+	return(j);
- }
- 
- /* regurgitate */
+@@ -635,7 +679,7 @@ edit(struct diff *diff, int dup, int j)
  __dead void
  edscript(int n)
  {
@@ -390,14 +310,16 @@
  	char block[BUFSIZ];
  
  	for (n = n; n > 0; n--) {
-@@ -657,7 +701,6 @@ edscript(int n)
+@@ -657,8 +701,7 @@ edscript(int n)
  			printf("%da\n%s\n.\n", de[n].old.from - 1, f1mark);
  		}
  	}
 -
- 	if( iflag )
+-	if( iflag )
++	if (iflag)
  		printf("w\nq\n");
  
+ 	exit(overlapcnt);
 @@ -698,13 +741,30 @@ increase(void)
  	szchanges = newsz;
  }


More information about the svn-soc-all mailing list