Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Jun 2012 01:14:45 +0000
From:      jhagewood@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r237106 - in soc2012/jhagewood/diff3: . diff3
Message-ID:  <20120605011445.CE2A6106566C@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhagewood
Date: Tue Jun  5 01:14:45 2012
New Revision: 237106
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237106

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	Tue Jun  5 01:03:10 2012	(r237105)
+++ soc2012/jhagewood/diff3/diff3/diff3prog.c	Tue Jun  5 01:14:45 2012	(r237106)
@@ -82,6 +82,9 @@
 
 /* diff3 - 3-way differential file comparison */
 
+extern char const *__progname;
+char const version_string[] = "8.1";
+
 /* diff3 [-ex3EX] d13 d23 f1 f2 f3 [m1 m3]
  *
  * d13 = diff report on f1 vs f3
@@ -156,14 +159,14 @@
 void usage(void);
 
 enum {  
-        HELP_OPT = CHAR_MAX + 1,
-        STRIPCR_OPT,
+    HELP_OPT = CHAR_MAX + 1,
+    STRIPCR_OPT,
 	DIFFPROG_OPT,
 };
 
 #define OPTIONS "3aAeEiL:mTvxX"
 static struct option longopts[] = {
-        { "ed",    		no_argument,		NULL,   'e' },
+    { "ed",    		no_argument,		NULL,   'e' },
 	{ "show-overlap", 	no_argument,		NULL,	'E' },
 	{ "overlap-only",	no_argument,		NULL,	'x' },
 	{ "initial-tab",	no_argument,		NULL,	'T' },
@@ -221,7 +224,7 @@
 			oflag = eflag = 1;
 			break;
 		case 'v':
-			printf("FreeBSD diff3 8.1\n");
+			printf("FreeBSD %s %s\n", __progname, version_string);
 			exit(0);
 		case 'x':
 			eflag = 1;
@@ -742,7 +745,6 @@
 void
 usage(void)
 {
-	extern char *__progname;
 
 	fprintf(stderr, "usage: %s [-exEX3] /tmp/d3a.?????????? "
 	    "/tmp/d3b.?????????? file1 file2 file3\n", __progname);

Modified: soc2012/jhagewood/diff3/hagewood-diff3.patch
==============================================================================
--- soc2012/jhagewood/diff3/hagewood-diff3.patch	Tue Jun  5 01:03:10 2012	(r237105)
+++ soc2012/jhagewood/diff3/hagewood-diff3.patch	Tue Jun  5 01:14:45 2012	(r237106)
@@ -1,7 +1,17 @@
 diff -rupN jhagewood/diff3/diff3-orig/diff3prog.c jhagewood/diff3/diff3/diff3prog.c
 --- jhagewood/diff3/diff3-orig/diff3prog.c	2012-06-04 23:30:11.000000000 -0400
-+++ jhagewood/diff3/diff3/diff3prog.c	2012-06-05 01:02:57.000000000 -0400
-@@ -151,7 +151,9 @@ void separate(const char *);
++++ jhagewood/diff3/diff3/diff3prog.c	2012-06-05 01:13:37.000000000 -0400
+@@ -82,6 +82,9 @@
+ 
+ /* diff3 - 3-way differential file comparison */
+ 
++extern char const *__progname;
++char const version_string[] = "8.1";
++
+ /* diff3 [-ex3EX] d13 d23 f1 f2 f3 [m1 m3]
+  *
+  * d13 = diff report on f1 vs f3
+@@ -151,22 +154,26 @@ void separate(const char *);
  __dead void edscript(int);
  __dead void trouble(void);
  void increase(void);
@@ -11,8 +21,18 @@
 +void usage(void);
  
  enum {  
-         HELP_OPT = CHAR_MAX + 1,
-@@ -166,7 +168,9 @@ static struct option longopts[] = {
+-        HELP_OPT = CHAR_MAX + 1,
+-        STRIPCR_OPT,
++    HELP_OPT = CHAR_MAX + 1,
++    STRIPCR_OPT,
+ 	DIFFPROG_OPT,
+ };
+ 
+ #define OPTIONS "3aAeEiL:mTvxX"
+ static struct option longopts[] = {
+-        { "ed",    		no_argument,		NULL,   'e' },
++    { "ed",    		no_argument,		NULL,   'e' },
+ 	{ "show-overlap", 	no_argument,		NULL,	'E' },
  	{ "overlap-only",	no_argument,		NULL,	'x' },
  	{ "initial-tab",	no_argument,		NULL,	'T' },
  	{ "text",		no_argument,		NULL,	'a' },
@@ -23,7 +43,7 @@
  	/* features to implement */
  	{ "show-all",		no_argument,		NULL,	'A' },
  	{ "easy-only", 		no_argument,		NULL,	'3' },
-@@ -174,8 +178,8 @@ static struct option longopts[] = {
+@@ -174,8 +181,8 @@ static struct option longopts[] = {
  	{ "label",		required_argument,	NULL,	'L' },
  	{ "strip-trailing-cr",	no_argument,		NULL,	STRIPCR_OPT },
  	{ "diff-program",	required_argument,	NULL,	DIFFPROG_OPT },
@@ -34,12 +54,12 @@
  };
  
  
-@@ -216,12 +220,19 @@ main(int argc, char **argv)
+@@ -216,12 +223,19 @@ main(int argc, char **argv)
  		case 'X':
  			oflag = eflag = 1;
  			break;
 +		case 'v':
-+			printf("FreeBSD diff3 8.1\n");
++			printf("FreeBSD %s %s\n", __progname, version_string);
 +			exit(0);
  		case 'x':
  			eflag = 1;
@@ -54,7 +74,7 @@
  		case STRIPCR_OPT:
  			strip_cr = 1;
  			break;
-@@ -233,8 +244,10 @@ main(int argc, char **argv)
+@@ -233,8 +247,10 @@ main(int argc, char **argv)
  	argc -= optind;
  	argv += optind;
  	/* XXX - argc usage seems wrong here */
@@ -66,7 +86,7 @@
  
  	if (oflag) {
  		(void)snprintf(f1mark, sizeof(f1mark), "<<<<<<< %s",
-@@ -699,12 +712,39 @@ increase(void)
+@@ -699,12 +715,38 @@ increase(void)
  }
  
  
@@ -101,7 +121,7 @@
 +void
  usage(void)
  {
- 	extern char *__progname;
+-	extern char *__progname;
  
  	fprintf(stderr, "usage: %s [-exEX3] /tmp/d3a.?????????? "
  	    "/tmp/d3b.?????????? file1 file2 file3\n", __progname);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120605011445.CE2A6106566C>