From c47ebdd0668b01a9227558c31febb0bd3d37f076 Mon Sep 17 00:00:00 2001 From: Ken Hornstein Date: Thu, 5 Jan 2012 13:39:47 -0500 Subject: [PATCH] Garbage collect all of the old UCI #ifdef'd code. --- docs/pending-release-notes | 2 + man/mh-profile.man | 7 +- uip/anno.c | 5 -- uip/conflict.c | 170 -------------------------------------------- uip/rmf.c | 4 -- uip/send.c | 15 ---- uip/whatnowsbr.c | 15 ---- 7 files changed, 4 insertions(+), 214 deletions(-) diff --git a/docs/pending-release-notes b/docs/pending-release-notes index c4ae22a..7c27535 100644 --- a/docs/pending-release-notes +++ b/docs/pending-release-notes @@ -5,3 +5,5 @@ Things to add to the release notes for the next full release: - mh-e support has been changed so that it is always compiled into nmh; old features that were previously enabled by the MHE option have been garbage collected. +- Old code enabled by the UCI preprocessor definition has been + garbage-collected. diff --git a/man/mh-profile.man b/man/mh-profile.man index e5a7b52..f8ae608 100644 --- a/man/mh-profile.man +++ b/man/mh-profile.man @@ -317,11 +317,8 @@ environment variable If .B $SIGNATURE is not set and this profile entry is not present, the \*(lqgcos\*(rq field of -the \fI/etc/passwd\fP file will be used; otherwise, on hosts where -.B nmh -was configured with the UCI option, the file -.I $HOME/.signature -is consulted. Your signature will be added to the address +the \fI/etc/passwd\fP file will be used. +Your signature will be added to the address .B send puts in the \*(lqFrom:\*(rq header; do not include an address in the signature text. (profile, no default) diff --git a/uip/anno.c b/uip/anno.c index 41716f7..ab15a4a 100644 --- a/uip/anno.c +++ b/uip/anno.c @@ -238,11 +238,6 @@ main (int argc, char **argv) return 1; } -#ifdef UCI - if (strcmp(invo_name, "fanno") == 0) /* ugh! */ - datesw = 0; -#endif /* UCI */ - if (!context_find ("path")) free (path ("./", TFOLDER)); if (!msgs.size) diff --git a/uip/conflict.c b/uip/conflict.c index 07e77fc..a3bd1d7 100644 --- a/uip/conflict.c +++ b/uip/conflict.c @@ -131,10 +131,6 @@ main (int argc, char **argv) grp_names (); grp_members (); grp_ids (); -#ifdef UCI - ldr_names (); - ldr_ship (); -#endif /* UCI */ maildrops (); done (0); @@ -379,169 +375,3 @@ setup (void) } } } - -#ifdef UCI -/* - * UCI specific stuff for conflict - */ - -/* taken from */ - -#define GLDRS "/admin/etc/GroupLeaders" - -struct grpldr { - char *gl_name; - char **gl_ldr; -}; - -int setglent (), endglent (); -struct grpldr *getglent (), *getglnam (); - - -/* taken from the getglent() routines */ - -#define MAXGLS 100 - -static FILE *glp = NULL; -static char line[BUFSIZ+1]; -static struct grpldr grpldr; -static char *gl_ldr[MAXGLS + 1]; - - -setglent() { - if (glp == NULL) - glp = fopen (GLDRS, "r"); - else - rewind (glp); - - return (glp != NULL); -} - - -endglent() { - if (glp != NULL) { - fclose (glp); - glp = NULL; - } - - return 1; -} - -struct grpldr *getglent () { - register char *cp, - **q; - - if (glp == NULL && !setglent ()) - return NULL; - if ((cp = fgets (line, BUFSIZ, glp)) == NULL) - return NULL; - - grpldr.gl_name = cp; - grpldr.gl_ldr = q = gl_ldr; - - while (*cp) { - while (*cp && !isspace (*cp)) - cp++; - while (*cp && isspace (*cp)) - *cp++ = '\0'; - if (*cp == '\0') - break; - if (q < gl_ldr + MAXGLS) - *q++ = cp; - else - break; - } - *q = NULL; - - return (&grpldr); -} - -struct grpldr *getglnam (name) -char *name; -{ - register struct grpldr *gl = NULL; - - setglent (); - while (gl = getglent ()) - if (strcmp (name, gl->gl_name) == 0) - break; - endglent (); - - return gl; -} - -ldr_names () { - register int gp, - hit = 0; - char *gldrs[NGRPS]; - register struct grpldr *gl; - - gldrs[0] = NULL; - setglent (); - while (gl = getglent ()) { - if (getgrnam (gl->gl_name) == NULL) { - setup (); - fprintf (out, "unknown group %s in group leaders file\n", - gl->gl_name); - hit++; - } - for (gp = 0; gldrs[gp]; gp++) - if (strcmp (gldrs[gp], gl->gl_name) == 0) { - setup (); - fprintf (out, "duplicate group %s in group leaders file\n", - gl->gl_name); - hit++; - break; - } - if (gldrs[gp] == NULL) - if (gp < NGRPS) { - gldrs[gp++] = getcpy (gl->gl_name); - gldrs[gp] = NULL; - } - else { - setup (); - fprintf (out, "more than %d groups in group leaders file%s\n", - " (time to recompile)", NGRPS - 1); - hit++; - } - } - endglent (); - - for (gp = 0; gldrs[gp]; gp++) - free (gldrs[gp]); - - if (!hit && out && !mail) - fprintf (out, "all groups in group leaders file accounted for\n"); -} - - -ldr_ship () { - register int hit = 0; - register char **cp, - **dp; - register struct grpldr *gl; - - setglent (); - while (gl = getglent ()) - for (cp = gl->gl_ldr; *cp; cp++) { - if (!check (*cp)) { - setup (); - fprintf (out, "group %s has unknown leader %s\n", - gl->gl_name, *cp); - hit++; - } - - for (dp = cp + 1; *dp; dp++) - if (strcmp (*cp, *dp) == 0) { - setup (); - fprintf (out, "group %s had duplicate leader %s\n", - gl->gl_name, *cp); - hit++; - } - } - endglent (); - - if (!hit && out && !mail) - fprintf (out, "all group leaders accounted for\n"); -} -#endif /* UCI */ diff --git a/uip/rmf.c b/uip/rmf.c index 563b20f..5631f78 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -169,10 +169,6 @@ rmf (char *folder) continue; /* else fall */ case ',': -#ifdef UCI - case '_': - case '#': -#endif /* UCI */ break; default: diff --git a/uip/send.c b/uip/send.c index d06b6c4..ad1cf39 100644 --- a/uip/send.c +++ b/uip/send.c @@ -153,9 +153,6 @@ main (int argc, char **argv) struct stat st; char *attach = (char *)0; /* header field name for attachments */ int attachformat = 0; /* mhbuild format specifier for attachments */ -#ifdef UCI - FILE *fp; -#endif /* UCI */ #ifdef LOCALE setlocale(LC_ALL, ""); @@ -401,18 +398,6 @@ go_to_it: if ((cp = getenv ("SIGNATURE")) == NULL || *cp == 0) if ((cp = context_find ("signature")) && *cp) m_putenv ("SIGNATURE", cp); -#ifdef UCI - else { - snprintf (buf, sizeof(buf), "%s/.signature", mypath); - if ((fp = fopen (buf, "r")) != NULL - && fgets (buf, sizeof buf, fp) != NULL) { - fclose (fp); - if (cp = strchr (buf, '\n')) - *cp = 0; - m_putenv ("SIGNATURE", buf); - } - } -#endif /* UCI */ for (msgnum = 0; msgnum < msgp; msgnum++) if (stat (msgs[msgnum], &st) == NOTOK) diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 6541b42..eaea7e1 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -1107,9 +1107,6 @@ sendit (char *sp, char **arg, char *file, int pushed) #ifndef lint int distsw = 0; #endif -#ifdef UCI - FILE *fp; -#endif /* * Make sure these are defined. In particular, we need @@ -1300,18 +1297,6 @@ sendit (char *sp, char **arg, char *file, int pushed) if ((cp = getenv ("SIGNATURE")) == NULL || *cp == 0) if ((cp = context_find ("signature")) && *cp) m_putenv ("SIGNATURE", cp); -#ifdef UCI - else { - snprintf (buf, sizeof(buf), "%s/.signature", mypath); - if ((fp = fopen (buf, "r")) != NULL - && fgets (buf, sizeof(buf), fp) != NULL) { - fclose (fp); - if (cp = strchr (buf, '\n')) - *cp = 0; - m_putenv ("SIGNATURE", buf); - } - } -#endif /* UCI */ if ((annotext = getenv ("mhannotate")) == NULL || *annotext == 0) annotext = NULL; -- 1.7.10.4