upas/ml: touch the artwork

Global variables deserve more greppable names,
since I'm likely to know where they're used.
This commit is contained in:
Ori Bernstein 2021-01-19 18:12:30 -08:00
parent 161560d8e8
commit 417dc79cff
2 changed files with 8 additions and 8 deletions

View file

@ -58,12 +58,12 @@ remaddr(char *addr)
Addr **l; Addr **l;
Addr *a; Addr *a;
for(l = &al; *l; l = &(*l)->next){ for(l = &addrlist; *l; l = &(*l)->next){
a = *l; a = *l;
if(strcmp(addr, a->addr) == 0){ if(strcmp(addr, a->addr) == 0){
(*l) = a->next; (*l) = a->next;
free(a); free(a);
na--; naddrlist--;
break; break;
} }
} }
@ -75,10 +75,10 @@ addaddr(char *addr)
Addr **l; Addr **l;
Addr *a; Addr *a;
for(l = &al; *l; l = &(*l)->next) for(l = &addrlist; *l; l = &(*l)->next)
if(strcmp(addr, (*l)->addr) == 0) if(strcmp(addr, (*l)->addr) == 0)
return 0; return 0;
na++; naddrlist++;
*l = a = malloc(sizeof(*a)+strlen(addr)+1); *l = a = malloc(sizeof(*a)+strlen(addr)+1);
if(a == nil) if(a == nil)
sysfatal("allocating: %r"); sysfatal("allocating: %r");
@ -147,12 +147,12 @@ startmailer(char *name)
dup(pfd[0], 0); dup(pfd[0], 0);
close(pfd[0]); close(pfd[0]);
av = malloc(sizeof(char*)*(na+2)); av = malloc(sizeof(char*)*(naddrlist+2));
if(av == nil) if(av == nil)
sysfatal("starting mailer: %r"); sysfatal("starting mailer: %r");
ac = 0; ac = 0;
av[ac++] = name; 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++] = a->addr;
av[ac] = 0; av[ac] = 0;
exec("/bin/upas/send", av); exec("/bin/upas/send", av);

View file

@ -12,8 +12,8 @@ struct Addr
String *from; String *from;
String *sender; String *sender;
Field *firstfield; Field *firstfield;
int na; int naddrlist;
Addr *al; Addr *addrlist;
extern String* getaddr(Node *p); extern String* getaddr(Node *p);
extern void getaddrs(void); extern void getaddrs(void);