removes trailing space characters and tabs from empty lines.
Index: who.c
===================================================================
RCS file: /cvs/src/usr.bin/who/who.c,v
retrieving revision 1.28
diff -u -p -r1.28 who.c
--- who.c 8 Aug 2018 22:55:14 -0000 1.28
+++ who.c 25 Jan 2019 14:33:36 -0000
@@ -113,7 +113,7 @@ main(int argc, char *argv[])
if (show_quick) {
only_current_term = show_term = show_idle = show_labels = 0;
}
-
+
if (show_term)
hostwidth -= 2;
if (show_idle)
@@ -134,7 +134,7 @@ main(int argc, char *argv[])
who_am_i(ufp);
} else if (show_quick) {
int count = 0;
-
+
while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1) {
if (*usr.ut_name && *usr.ut_line) {
(void)printf("%-*.*s ", NAME_WIDTH,
@@ -232,7 +232,7 @@ output(struct utmp *up)
if (show_term || show_idle) {
if (now == 0)
time(&now);
-
+
memset(line, 0, sizeof line);
strlcpy(line, _PATH_DEV, sizeof line);
strlcat(line, up->ut_line, sizeof line);
@@ -244,7 +244,7 @@ output(struct utmp *up)
state = '?';
idle = 0;
}
-
+
}
(void)printf("%-*.*s ", NAME_WIDTH, UT_NAMESIZE, up->ut_name);
@@ -257,16 +257,16 @@ output(struct utmp *up)
(void)printf("%.12s ", ctime(&up->ut_time) + 4);
if (show_idle) {
- if (idle < 60)
+ if (idle < 60)
(void)printf(" . ");
else if (idle < (24 * 60 * 60))
- (void)printf("%02d:%02d ",
+ (void)printf("%02d:%02d ",
((int)idle / (60 * 60)),
((int)idle % (60 * 60)) / 60);
else
(void)printf(" old ");
}
-
+
if (*up->ut_host)
printf(" (%.*s)", hostwidth, up->ut_host);
(void)putchar('\n');
--
Sean