public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
861f6d3
)
who: fix use as users when a path is given
author
Alan Cox
<alan@linux.intel.com>
Sun, 12 Nov 2017 21:07:37 +0000
(21:07 +0000)
committer
Alan Cox
<alan@linux.intel.com>
Sun, 12 Nov 2017 21:07:37 +0000
(21:07 +0000)
Applications/util/who.c
patch
|
blob
|
history
diff --git
a/Applications/util/who.c
b/Applications/util/who.c
index
b50edc9
..
3d87289
100644
(file)
--- a/
Applications/util/who.c
+++ b/
Applications/util/who.c
@@
-24,11
+24,17
@@
void main(int argc, char *argv[])
{
-
register
struct utmp *entry;
+ struct utmp *entry;
char *timestr;
+ char *p;
uint8_t fmt = 0;
- if (strcmp(argv[0], "users") == 0)
+ p = strchr(argv[0],'/');
+ if (p)
+ p++;
+ else
+ p = argv[0];
+ if (strcmp(p, "users") == 0)
fmt = 1;
setutent();
while ((entry = getutent()) != NULL) {