ref: 417dc79cff844b8fcb7d64211e728c263b852356
parent: 161560d8e89314d3f47495bb60e354a3a949041e
author: Ori Bernstein <[email protected]>
date: Tue Jan 19 13:12:30 EST 2021
upas/ml: touch the artwork Global variables deserve more greppable names, since I'm likely to know where they're used.
--- a/sys/src/cmd/upas/ml/common.c
+++ b/sys/src/cmd/upas/ml/common.c
@@ -58,12 +58,12 @@
Addr **l;
Addr *a;
- for(l = &al; *l; l = &(*l)->next){
+ for(l = &addrlist; *l; l = &(*l)->next){
a = *l;
if(strcmp(addr, a->addr) == 0){
(*l) = a->next;
free(a);
- na--;
+ naddrlist--;
break;
}
}
@@ -75,10 +75,10 @@
Addr **l;
Addr *a;
- for(l = &al; *l; l = &(*l)->next)
+ for(l = &addrlist; *l; l = &(*l)->next)
if(strcmp(addr, (*l)->addr) == 0)
return 0;
- na++;
+ naddrlist++;
*l = a = malloc(sizeof(*a)+strlen(addr)+1);
if(a == nil)
sysfatal("allocating: %r");
@@ -147,12 +147,12 @@
dup(pfd[0], 0);
close(pfd[0]);
- av = malloc(sizeof(char*)*(na+2));
+ av = malloc(sizeof(char*)*(naddrlist+2));
if(av == nil)
sysfatal("starting mailer: %r");
ac = 0;
av[ac++] = name;
- for(a = al; a != nil; a = a->next)
+ for(a = addrlist; a != nil; a = a->next)
av[ac++] = a->addr;
av[ac] = 0;
exec("/bin/upas/send", av);
--- a/sys/src/cmd/upas/ml/dat.h
+++ b/sys/src/cmd/upas/ml/dat.h
@@ -12,8 +12,8 @@
String *from;
String *sender;
Field *firstfield;
-int na;
-Addr *al;
+int naddrlist;
+Addr *addrlist;
extern String* getaddr(Node *p);
extern void getaddrs(void);