[hackers] [ubase] Print system login processes correctly when doing who -l || sin

From: <git_AT_suckless.org>
Date: Tue, 25 Mar 2014 13:44:15 +0100

commit 07592f31be3927dd1e9e6a4d82e4049c52cde48c
Author: sin <sin_AT_2f30.org>
Date: Tue Mar 25 12:38:47 2014 +0000

    Print system login processes correctly when doing who -l
    
    Fix style as well.

diff --git a/who.c b/who.c
index f05cf54..c46a6ac 100644
--- a/who.c
+++ b/who.c
_AT_@ -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));
_AT_@ -60,4 +60,3 @@ main(int argc, char **argv)
         fclose(ufp);
         return EXIT_SUCCESS;
 }
-
Received on Tue Mar 25 2014 - 13:44:15 CET

This archive was generated by hypermail 2.3.0 : Tue Mar 25 2014 - 13:48:19 CET