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

jhagewood at FreeBSD.org jhagewood at FreeBSD.org
Mon Jun 11 00:53:36 UTC 2012


Author: jhagewood
Date: Mon Jun 11 00:53:33 2012
New Revision: 237433
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237433

Log:

Modified:
  soc2012/jhagewood/diff/diff/diff.c
  soc2012/jhagewood/diff/diff/diffreg.c
  soc2012/jhagewood/diff/hagewood-diff.patch

Modified: soc2012/jhagewood/diff/diff/diff.c
==============================================================================
--- soc2012/jhagewood/diff/diff/diff.c	Sun Jun 10 23:48:14 2012	(r237432)
+++ soc2012/jhagewood/diff/diff/diff.c	Mon Jun 11 00:53:33 2012	(r237433)
@@ -547,7 +547,7 @@
 		    path1, entry ? entry : "", path2, entry ? entry : "");
 		break;
 	case D_BINARY:
-		printf("Binary files %s%s and %s%s differ\n",
+		printf("Files %s%s and %s%s differ\n",
 		    path1, entry ? entry : "", path2, entry ? entry : "");
 		break;
 	case D_DIFFER:

Modified: soc2012/jhagewood/diff/diff/diffreg.c
==============================================================================
--- soc2012/jhagewood/diff/diff/diffreg.c	Sun Jun 10 23:48:14 2012	(r237432)
+++ soc2012/jhagewood/diff/diff/diffreg.c	Mon Jun 11 00:53:33 2012	(r237433)
@@ -1551,13 +1551,19 @@
 static void
 print_header(const char *file1, const char *file2)
 {
+	const char *time_format;
+#ifdef ST_MTIM_NSEC
+	time_format = "%Y-%m-%d %H:%M:%S.%N %z";
+#else
+	time_format = "%Y-%m-%d %H:%M:%S %z";
+#endif
 	struct tm *tm_ptr1, *tm_ptr2;
 	char buf1[256];
 	char buf2[256];
 	tm_ptr1 = localtime(&stb1.st_mtime);
 	tm_ptr2 = localtime(&stb2.st_mtime);
-	strftime(buf1, 256, "%Y-%m-%d %H:%M:%S %z", tm_ptr1);
-	strftime(buf2, 256, "%Y-%m-%d %H:%M:%S %z", tm_ptr2);
+	strftime(buf1, 256, time_format, tm_ptr1);
+	strftime(buf2, 256, time_format, tm_ptr2);
 	if (label[0] != NULL)
 		printf("%s %s\n", format == D_CONTEXT ? "***" : "---",
 		    label[0]);

Modified: soc2012/jhagewood/diff/hagewood-diff.patch
==============================================================================
--- soc2012/jhagewood/diff/hagewood-diff.patch	Sun Jun 10 23:48:14 2012	(r237432)
+++ soc2012/jhagewood/diff/hagewood-diff.patch	Mon Jun 11 00:53:33 2012	(r237433)
@@ -1,6 +1,6 @@
 diff -rupN jhagewood/diff/diff-orig/diff.c jhagewood/diff/diff/diff.c
 --- jhagewood/diff/diff-orig/diff.c	2012-06-10 03:31:05.000000000 -0400
-+++ jhagewood/diff/diff/diff.c	2012-06-10 03:35:06.000000000 -0400
++++ jhagewood/diff/diff/diff.c	2012-06-11 00:46:52.000000000 -0400
 @@ -129,7 +129,6 @@ static struct option longopts[] = {
  	{ "report-identical-files",	no_argument,		NULL,	's' },
  	{ "initial-tab",		no_argument,		NULL,	'T' },
@@ -9,20 +9,35 @@
  	{ "unified",			optional_argument,	NULL,	'U' },
  	{ "version",			no_argument,		NULL,	'v' },
  /* XXX: UNIMPLEMENTED
+@@ -548,7 +547,7 @@ print_status(int val, char *path1, char 
+ 		    path1, entry ? entry : "", path2, entry ? entry : "");
+ 		break;
+ 	case D_BINARY:
+-		printf("Binary files %s%s and %s%s differ\n",
++		printf("Files %s%s and %s%s differ\n",
+ 		    path1, entry ? entry : "", path2, entry ? entry : "");
+ 		break;
+ 	case D_DIFFER:
 diff -rupN jhagewood/diff/diff-orig/diffreg.c jhagewood/diff/diff/diffreg.c
 --- jhagewood/diff/diff-orig/diffreg.c	2012-06-10 03:31:05.000000000 -0400
-+++ jhagewood/diff/diff/diffreg.c	2012-06-10 03:31:05.000000000 -0400
-@@ -1551,16 +1551,23 @@ dump_unified_vec(FILE *f1, FILE *f2)
++++ jhagewood/diff/diff/diffreg.c	2012-06-11 00:49:41.000000000 -0400
+@@ -1551,16 +1551,29 @@ dump_unified_vec(FILE *f1, FILE *f2)
  static void
  print_header(const char *file1, const char *file2)
  {
++	const char *time_format;
++#ifdef ST_MTIM_NSEC
++	time_format = "%Y-%m-%d %H:%M:%S.%N %z";
++#else
++	time_format = "%Y-%m-%d %H:%M:%S %z";
++#endif
 +	struct tm *tm_ptr1, *tm_ptr2;
 +	char buf1[256];
 +	char buf2[256];
 +	tm_ptr1 = localtime(&stb1.st_mtime);
 +	tm_ptr2 = localtime(&stb2.st_mtime);
-+	strftime(buf1, 256, "%Y-%m-%d %H:%M:%S %z", tm_ptr1);
-+	strftime(buf2, 256, "%Y-%m-%d %H:%M:%S %z", tm_ptr2);
++	strftime(buf1, 256, time_format, tm_ptr1);
++	strftime(buf2, 256, time_format, tm_ptr2);
  	if (label[0] != NULL)
  		printf("%s %s\n", format == D_CONTEXT ? "***" : "---",
  		    label[0]);


More information about the svn-soc-all mailing list