socsvn commit: r238509 - in soc2012/jhagewood/diff: . diff

jhagewood at FreeBSD.org jhagewood at FreeBSD.org
Thu Jun 28 21:38:56 UTC 2012


Author: jhagewood
Date: Thu Jun 28 21:38:53 2012
New Revision: 238509
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=238509

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	Thu Jun 28 21:27:54 2012	(r238508)
+++ soc2012/jhagewood/diff/diff/diffreg.c	Thu Jun 28 21:38:53 2012	(r238509)
@@ -1351,14 +1351,16 @@
 istextfile(FILE *f)
 {
 	char buf[BUFSIZ];
-	int	i, cnt;
+	int	cnt;
 
 	if (aflag || f == NULL)
 		return (1);
 	rewind(f);
 	fread(buf, 1, BUFSIZ, f);
-	if (memchr(buf, '\0', BUFSIZ) != NULL)
+	if (cnt = memchr(buf, '\0', BUFSIZ) != NULL) {
+		printf("%d\n", cnt);
 		return (0);
+	}
 	return (1);
 }
 

Modified: soc2012/jhagewood/diff/hagewood-diff.patch
==============================================================================
--- soc2012/jhagewood/diff/hagewood-diff.patch	Thu Jun 28 21:27:54 2012	(r238508)
+++ soc2012/jhagewood/diff/hagewood-diff.patch	Thu Jun 28 21:38:53 2012	(r238509)
@@ -623,7 +623,7 @@
  	if (stat(path1, &stb1) != 0) {
 diff -rupN jhagewood/diff/diff-orig/diffreg.c jhagewood/diff/diff/diffreg.c
 --- jhagewood/diff/diff-orig/diffreg.c	2012-06-28 02:16:56.000000000 -0400
-+++ jhagewood/diff/diff/diffreg.c	2012-06-28 17:03:06.000000000 -0400
++++ jhagewood/diff/diff/diffreg.c	2012-06-28 17:22:00.000000000 -0400
 @@ -62,15 +62,13 @@
   *	@(#)diffreg.c   8.1 (Berkeley) 6/6/93
   */
@@ -1135,7 +1135,7 @@
  
  	sum = 1;
  	space = 0;
-@@ -1305,20 +1344,21 @@ readhash(FILE *f)
+@@ -1305,20 +1344,23 @@ readhash(FILE *f)
  	return (sum == 0 ? 1 : sum);
  }
  
@@ -1149,7 +1149,7 @@
 -	char		 buf[BUFSIZ];
 -	int		 i, cnt;
 +	char buf[BUFSIZ];
-+	int	i, cnt;
++	int	cnt;
  
  	if (aflag || f == NULL)
  		return (1);
@@ -1160,12 +1160,14 @@
 -		if (!isprint(buf[i]) && !isspace(buf[i]))
 -			return (0);
 +	fread(buf, 1, BUFSIZ, f);
-+	if (memchr(buf, '\0', BUFSIZ) != NULL)
++	if (cnt = memchr(buf, '\0', BUFSIZ) != NULL) {
++		printf("%d\n", cnt);
 +		return (0);
++	}
  	return (1);
  }
  
-@@ -1327,10 +1367,10 @@ asciifile(FILE *f)
+@@ -1327,10 +1369,10 @@ asciifile(FILE *f)
  static char *
  match_function(const long *f, int pos, FILE *file)
  {
@@ -1180,7 +1182,7 @@
  
  	lastline = pos;
  	while (pos > last) {
-@@ -1342,7 +1382,6 @@ match_function(const long *f, int pos, F
+@@ -1342,7 +1384,6 @@ match_function(const long *f, int pos, F
  		if (nc > 0) {
  			buf[nc] = '\0';
  			buf[strcspn(buf, "\n")] = '\0';
@@ -1188,7 +1190,7 @@
  			if (isalpha(buf[0]) || buf[0] == '_' || buf[0] == '$') {
  				if (begins_with(buf, "private:")) {
  					if (!state)
-@@ -1373,9 +1412,9 @@ static void
+@@ -1373,9 +1414,9 @@ static void
  dump_context_vec(FILE *f1, FILE *f2)
  {
  	struct context_vec *cvp = context_vec_start;
@@ -1201,7 +1203,7 @@
  
  	if (context_vec_start > context_vec_ptr)
  		return;
-@@ -1390,8 +1429,8 @@ dump_context_vec(FILE *f1, FILE *f2)
+@@ -1390,8 +1431,8 @@ dump_context_vec(FILE *f1, FILE *f2)
  	if (pflag) {
  		f = match_function(ixold, lowa-1, f1);
  		if (f != NULL) {
@@ -1212,7 +1214,7 @@
  		}
  	}
  	printf("\n*** ");
-@@ -1478,9 +1517,9 @@ static void
+@@ -1478,9 +1519,9 @@ static void
  dump_unified_vec(FILE *f1, FILE *f2)
  {
  	struct context_vec *cvp = context_vec_start;
@@ -1225,7 +1227,7 @@
  
  	if (context_vec_start > context_vec_ptr)
  		return;
-@@ -1491,19 +1530,19 @@ dump_unified_vec(FILE *f1, FILE *f2)
+@@ -1491,19 +1532,19 @@ dump_unified_vec(FILE *f1, FILE *f2)
  	lowc = MAX(1, cvp->c - context);
  	upd = MIN(len[1], context_vec_ptr->d + context);
  
@@ -1251,7 +1253,7 @@
  
  	/*
  	 * Output changes in "unified" diff format--the old and new lines
-@@ -1551,16 +1590,43 @@ dump_unified_vec(FILE *f1, FILE *f2)
+@@ -1551,16 +1592,43 @@ dump_unified_vec(FILE *f1, FILE *f2)
  static void
  print_header(const char *file1, const char *file2)
  {


More information about the svn-soc-all mailing list