[Pkg-sysvinit-devel] Bug#367428: last patch

Bob Mroczka rmroczk at searshc.com
Thu Jan 4 20:50:21 CET 2007


Skipped content of type multipart/alternative-------------- next part --------------
--- src/last.c.orig	2004-07-30 07:16:26.000000000 -0500
+++ src/last.c	2007-01-04 13:16:14.000000000 -0600
@@ -449,21 +449,31 @@
 		if (!usedns && (s = strchr(p->ut_host, '.')) != NULL &&
 		     strcmp(s + 1, domainname) == 0) *s = 0;
 #endif
+#define str(s) # s
+#define xstr(s) str(s)
 		if (!altlist) {
 			snprintf(final, sizeof(final),
-				"%-8.8s %-12.12s %-16.16s "
-				"%-16.16s %-7.7s %-12.12s\n",
+				oldfmt ? "%-" xstr(OLD_NAMESIZE) "." xstr(OLD_NAMESIZE) "s %-12.12s "
+							"%-16.16s %-16.16s %-7.7s %-12.12s\n"
+					   : "%-" xstr(UT_NAMESIZE) "." xstr(UT_NAMESIZE) "s %-12.12s "
+							"%-16.16s %-16.16s %-7.7s %-12.12s\n",
 				p->ut_name, utline,
 				domain, logintime, logouttime, length);
 		} else {
 			snprintf(final, sizeof(final), 
-				"%-8.8s %-12.12s %-16.16s %-7.7s %-12.12s %s\n",
+				oldfmt ? "%-" xstr(OLD_NAMESIZE) "." xstr(OLD_NAMESIZE) "s %-12.12s "
+							"%-16.16s %-7.7s %-16.16s %s\n"
+				       : "%-" xstr(UT_NAMESIZE) "." xstr(UT_NAMESIZE) "s %-12.12s "
+							"%-16.16s %-7.7s %-16.16s %s\n",
 				p->ut_name, utline,
 				logintime, logouttime, length, domain);
 		}
 	} else
 		snprintf(final, sizeof(final),
-			"%-8.8s %-12.12s %-16.16s %-7.7s %-12.12s\n",
+			oldfmt ? "%-" xstr(OLD_NAMESIZE) "." xstr(OLD_NAMESIZE) "s %-12.12s "
+						"%-16.16s %-7.7s %-12.12s\n"
+				   : "%-" xstr(UT_NAMESIZE) "." xstr(UT_NAMESIZE) "s %-12.12s "
+						"%-16.16s %-7.7s %-12.12s\n",
 			p->ut_name, utline,
 			logintime, logouttime, length);
 


More information about the Pkg-sysvinit-devel mailing list