From 417dc79cff844b8fcb7d64211e728c263b852356 Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Tue, 19 Jan 2021 18:12:30 -0800 Subject: [PATCH] upas/ml: touch the artwork Global variables deserve more greppable names, since I'm likely to know where they're used. --- sys/src/cmd/upas/ml/common.c | 12 ++++++------ sys/src/cmd/upas/ml/dat.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/src/cmd/upas/ml/common.c b/sys/src/cmd/upas/ml/common.c index 670c2989c..7848d50c2 100644 --- a/sys/src/cmd/upas/ml/common.c +++ b/sys/src/cmd/upas/ml/common.c @@ -58,12 +58,12 @@ remaddr(char *addr) 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 @@ addaddr(char *addr) 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 @@ startmailer(char *name) 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); diff --git a/sys/src/cmd/upas/ml/dat.h b/sys/src/cmd/upas/ml/dat.h index 5d23bae8f..18480e38c 100644 --- a/sys/src/cmd/upas/ml/dat.h +++ b/sys/src/cmd/upas/ml/dat.h @@ -12,8 +12,8 @@ struct Addr String *from; String *sender; Field *firstfield; -int na; -Addr *al; +int naddrlist; +Addr *addrlist; extern String* getaddr(Node *p); extern void getaddrs(void);