Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154964876
D21390.id61197.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D21390.id61197.diff
View Options
Index: usr.bin/w/w.c
===================================================================
--- usr.bin/w/w.c
+++ usr.bin/w/w.c
@@ -118,6 +118,7 @@
char *args; /* arg list of interesting process */
struct kinfo_proc *dkp; /* debug option proc list */
char *from; /* "from": name or addr */
+ char *save_from; /* original "from": name or addr */
} *ep, *ehead = NULL, **nextp = &ehead;
#define debugproc(p) *(&((struct kinfo_proc *)p)->ki_udata)
@@ -209,7 +210,6 @@
if (*argv)
sel_users = argv;
- save_p = NULL;
setutxent();
for (nusers = 0; (utmp = getutxent()) != NULL;) {
struct addrinfo hints, *res;
@@ -312,6 +312,8 @@
ep->from = strdup(p);
if ((i = strlen(p)) > fromwidth)
fromwidth = i;
+ if (save_p != p)
+ ep->save_from = strdup(save_p);
}
endutxent();
@@ -451,8 +453,8 @@
strncmp(ep->utmp.ut_line, "cua", 3) ?
ep->utmp.ut_line : ep->utmp.ut_line + 3) : "-");
- if (save_p && save_p != p)
- xo_attr("address", "%s", save_p);
+ if (ep->save_from)
+ xo_attr("address", "%s", ep->save_from);
xo_emit("{:from/%-*.*s/%@**@s} ",
fromwidth, fromwidth, ep->from);
t = ep->utmp.ut_tv.tv_sec;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 1, 8:48 AM (12 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32567249
Default Alt Text
D21390.id61197.diff (1 KB)
Attached To
Mode
D21390: Fix address annotation in xml output from w
Attached
Detach File
Event Timeline
Log In to Comment