Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/comms/bforce-kst/files/patch-nlookup.c
16461 views
1
--- bfutil/nlookup.c.orig Thu Aug 30 16:33:51 2001
2
+++ bfutil/nlookup.c Sat Jun 19 07:05:34 2004
3
@@ -28,15 +28,34 @@
4
static void usage(void)
5
{
6
printf_usage("nodelist lookup utility",
7
- "usage: nlookup [-rh] <address>\n"
8
+ "usage: nlookup [-rmh] <address>\n"
9
"\n"
10
"options:\n"
11
" -r show nodelist string\n"
12
+ " -m show email address\n"
13
" -h show this help message\n"
14
"\n"
15
);
16
}
17
18
+void print_nodemail(const s_node *node)
19
+{
20
+ char abuf[BF_MAXADDRSTR+1];
21
+
22
+ if( node->sysop && *node->sysop && strcmp(node->sysop, "<none>") )
23
+ {
24
+ char username[BNI_MAXSYSOP+1];
25
+
26
+ strnxcpy(username, node->sysop, sizeof(node->sysop));
27
+ string_replchar(username, ' ', '_');
28
+
29
+ printf("%s@%s.fidonet.org\n", username,
30
+ ftn_addrstr_inet(abuf, node->addr));
31
+ }
32
+
33
+ fflush(stdout);
34
+}
35
+
36
void print_nodeinfo(const s_node *node)
37
{
38
char abuf[BF_MAXADDRSTR+1];
39
@@ -124,6 +143,9 @@
40
}
41
else if( nodelist_lookup(&node, addr) == 0 )
42
{
43
+ if( emailaddr )
44
+ print_nodemail(&node);
45
+ else
46
print_nodeinfo(&node);
47
}
48
49
50