Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Aug 2010 15:53:49 GMT
From:      Benjamin Fiedler <bfiedler@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 181777 for review
Message-ID:  <201008031553.o73Frnss003755@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@181777?ac=10

Change 181777 by bfiedler@freebsd-home on 2010/08/03 15:53:34

	Add .sh script for calling diff3prog (since ksh is not included by default). -T flag support.

Affected files ...

.. //depot/projects/soc2010/bsdtextproc/diff3/diff3.sh#1 add
.. //depot/projects/soc2010/bsdtextproc/diff3/diff3prog.c#3 edit

Differences ...

==== //depot/projects/soc2010/bsdtextproc/diff3/diff3prog.c#3 (text+ko) ====

@@ -123,7 +123,7 @@
  * is stored in last[1-3];
  */
 int last[4];
-int eflag, iflag;
+int Aflag, eflag, iflag, Tflag;
 int oflag;		/* indicates whether to mark overlaps (-E or -X)*/
 int strip_cr;
 int debug  = 0;
@@ -158,6 +158,7 @@
         { "ed",    		no_argument,		NULL,   'e' },
 	{ "show-overlap", 	no_argument,		NULL,	'E' },
 	{ "overlap-only",	no_argument,		NULL,	'x' },
+	{ "initial-tab",	no_argument,		NULL,	'T' },
 
 	/* features to implement */
 	{ "show-all",		no_argument,		NULL,	'A' },
@@ -166,7 +167,6 @@
 	{ "label",		required_argument,	NULL,	'L' },
 	{ "text",		no_argument,		NULL,	'a' },
 	{ "strip-trailing-cr",	no_argument,		NULL,	STRIPCR_OPT },
-	{ "initial-tab",	no_argument,		NULL,	'T' },
 	{ "diff-program",	required_argument,	NULL,	DIFFPROG_OPT },
 	{ "version",		no_argument,		NULL,	'v' },
 	{ "help",		no_argument,		NULL,	HELP_OPT }
@@ -182,6 +182,9 @@
 	oflag = 0;
 	while ((ch = getopt_long(argc, argv, OPTIONS, longopts, NULL)) != -1) {
 		switch (ch) {
+		case 'A':
+			Aflag = 1;
+			break;
 		case 'E':
 			eflag = 3;
 			oflag = 1;
@@ -192,6 +195,9 @@
 		case 'i':
 			iflag = 1;
 			break;
+		case 'T':
+			Tflag = 1;
+			break;
 		case 'X':
 			oflag = eflag = 1;
 			break;
@@ -500,7 +506,12 @@
 		if ((line = getline(fp[i], &j)) == NULL)
 			trouble();
 		if (pr != NULL)
-			printf("%s%s", pr, line);
+		{
+			if(Tflag == 1)
+				printf("\t%s", line);
+			else
+				printf("%s%s", pr, line);
+		}
 		cline[i]++;
 	}
 	return ((int) n);



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