ubase

suckless linux base utils
git clone git://git.2f30.org/ubase
Log | Files | Refs | README | LICENSE

commit 07592f31be3927dd1e9e6a4d82e4049c52cde48c
parent 9031fcfd29ee05c6e3d66eaa0b888a0375bf8cf6
Author: sin <sin@2f30.org>
Date:   Tue, 25 Mar 2014 12:38:47 +0000

Print system login processes correctly when doing who -l

Fix style as well.

Diffstat:
Mwho.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/who.c b/who.c @@ -49,9 +49,9 @@ main(int argc, char **argv) if (!*usr.ut_name || !*usr.ut_line || usr.ut_line[0] == '~') continue; - if (mflag && strcmp(usr.ut_line, tty)) + if (mflag != 0 && strcmp(usr.ut_line, tty) != 0) continue; - if (strcmp(usr.ut_name, "LOGIN") == lflag) + if (!!strcmp(usr.ut_name, "LOGIN") == lflag) continue; t = usr.ut_time; strftime(timebuf, sizeof timebuf, "%Y-%m-%d %H:%M", localtime(&t)); @@ -60,4 +60,3 @@ main(int argc, char **argv) fclose(ufp); return EXIT_SUCCESS; } -