tiny usability patch for julian date

[email protected] Wed, 21 Mar 2007 23:42:32 -0400
Newsgroups gmane.comp.gnu.screen
Message-ID <[email protected]>
Hi screen-devs,

Thanks for such a great tool, screen generally improves my quality of
life. :-) Here is a very small patch which increases some usability
options for the hardstatus, and possibly other %format capable
strings. The patch gives a user the ability to specify %j to get the
Julian day of year, which can be quite handy if you're managing many
servers which use that format from localtime in their syslog..

I've tested the patch on my system, and it is working well. Thanks in advance,
-jieryn

-- 
There are 10 types of people in this world, those
that can read binary and those that can not.
4.0.3-julian-date.patch (application/octet-stream, 1.4 KB)
diff -upr screen-4.0.3.orig/doc/screen.1 screen-4.0.3/doc/screen.1
--- screen-4.0.3.orig/doc/screen.1	2003-12-05 08:51:57.000000000 -0500
+++ screen-4.0.3/doc/screen.1	2007-03-21 19:08:57.000000000 -0400
@@ -3266,6 +3266,8 @@ either 'AM' or 'PM'
 current time HH:MM in 24h format
 .IP C
 current time HH:MM in 12h format
+.IP j
+Julian day number
 .IP d
 day number
 .IP D
diff -upr screen-4.0.3.orig/doc/screen.texinfo screen-4.0.3/doc/screen.texinfo
--- screen-4.0.3.orig/doc/screen.texinfo	2003-12-05 08:51:46.000000000 -0500
+++ screen-4.0.3/doc/screen.texinfo	2007-03-21 19:09:10.000000000 -0400
@@ -4732,6 +4732,8 @@ either @code{AM} or @code{PM}
 current time @code{HH:MM} in 24h format
 @item C
 current time @code{HH:MM} in 12h format
+@item j
+Julian day number
 @item d
 day number
 @item D
diff -upr screen-4.0.3.orig/screen.c screen-4.0.3/screen.c
--- screen-4.0.3.orig/screen.c	2003-09-08 10:26:41.000000000 -0400
+++ screen-4.0.3/screen.c	2007-03-21 19:08:44.000000000 -0400
@@ -2394,7 +2394,7 @@ int rec;
 	    }
 	  break;
 	case 'd': case 'D': case 'm': case 'M': case 'y': case 'Y':
-	case 'a': case 'A': case 's': case 'c': case 'C':
+	case 'a': case 'A': case 's': case 'c': case 'C': case 'j':
 	  if (l < 4)
 	    break;
 	  if (tm == 0)
@@ -2453,6 +2453,9 @@ int rec;
 	      if (!tick || tick > 60)
 		tick = 60;
 	      break;
+	    case 'j':
+	      sprintf(p, "%03d", tm->tm_yday + 1);
+	      break;
 	    default:
 	      break;
 	    }