From bfad64befb4d6696fdfb63b119666eec4bac6fb3 Mon Sep 17 00:00:00 2001 From: David Levine Date: Tue, 11 Dec 2012 19:45:29 -0600 Subject: [PATCH] Removed some dead code, all inside #if 0's. I tried to not remove anything useful, so there are a few #if 0's remaining. --- sbr/dtime.c | 14 -------- sbr/getansreadline.c | 94 -------------------------------------------------- uip/ali.c | 5 --- uip/inc.c | 46 ------------------------ uip/mhbuildsbr.c | 5 --- uip/mhcachesbr.c | 8 ----- uip/mhshowsbr.c | 5 --- uip/scan.c | 11 ------ uip/slocal.c | 19 ---------- 9 files changed, 207 deletions(-) diff --git a/sbr/dtime.c b/sbr/dtime.c index 6acfaeb..acab877 100644 --- a/sbr/dtime.c +++ b/sbr/dtime.c @@ -402,20 +402,6 @@ void twscopy (struct tws *tb, struct tws *tw) { *tb = *tw; /* struct copy */ - -#if 0 - tb->tw_sec = tw->tw_sec; - tb->tw_min = tw->tw_min; - tb->tw_hour = tw->tw_hour; - tb->tw_mday = tw->tw_mday; - tb->tw_mon = tw->tw_mon; - tb->tw_year = tw->tw_year; - tb->tw_wday = tw->tw_wday; - tb->tw_yday = tw->tw_yday; - tb->tw_zone = tw->tw_zone; - tb->tw_clock = tw->tw_clock; - tb->tw_flags = tw->tw_flags; -#endif } diff --git a/sbr/getansreadline.c b/sbr/getansreadline.c index 2fd0618..fc03c97 100644 --- a/sbr/getansreadline.c +++ b/sbr/getansreadline.c @@ -24,100 +24,6 @@ static char **nmh_completion(const char *, int, int); static void initialize_readline(void); static char ansbuf[BUFSIZ]; -#if 0 -static sigjmp_buf sigenv; - -/* - * static prototypes - */ -static void intrser (int); - - -char ** -getans (char *prompt, struct swit *ansp) -{ - int i; - SIGNAL_HANDLER istat = NULL; - char *cp, **cpp; - - if (!(sigsetjmp(sigenv, 1))) { - istat = SIGNAL (SIGINT, intrser); - } else { - SIGNAL (SIGINT, istat); - return NULL; - } - - for (;;) { - printf ("%s", prompt); - fflush (stdout); - cp = ansbuf; - while ((i = getchar ()) != '\n') { - if (i == EOF) { - /* - * If we get an EOF, return - */ - if (feof(stdin)) - siglongjmp (sigenv, 1); - - /* - * For errors, if we get an EINTR that means that we got - * a signal and we should retry. If we get another error, - * then just return. - */ - - else if (ferror(stdin)) { - if (errno == EINTR) { - clearerr(stdin); - continue; - } - fprintf(stderr, "\nError %s during read\n", - strerror(errno)); - siglongjmp (sigenv, 1); - } else { - /* - * Just for completeness's sake ... - */ - - fprintf(stderr, "\nUnknown problem in getchar()\n"); - siglongjmp (sigenv, 1); - } - } - if (cp < &ansbuf[sizeof ansbuf - 1]) - *cp++ = i; - } - *cp = '\0'; - if (ansbuf[0] == '?' || cp == ansbuf) { - printf ("Options are:\n"); - print_sw (ALL, ansp, "", stdout); - continue; - } - cpp = brkstring (ansbuf, " ", NULL); - switch (smatch (*cpp, ansp)) { - case AMBIGSW: - ambigsw (*cpp, ansp); - continue; - case UNKWNSW: - printf (" -%s unknown. Hit for help.\n", *cpp); - continue; - default: - SIGNAL (SIGINT, istat); - return cpp; - } - } -} - - -static void -intrser (int i) -{ - NMH_UNUSED (i); - - /* - * should this be siglongjmp? - */ - siglongjmp (sigenv, 1); -} -#endif /* * getans, but with readline support diff --git a/uip/ali.c b/uip/ali.c index e9a63fd..880fe21 100644 --- a/uip/ali.c +++ b/uip/ali.c @@ -249,12 +249,7 @@ print_usr (char *s, int list, int norm) } mnfree (mp); -#if 0 - printf ("%s: ", s); - print_aka (vp ? vp : s, list, pos += strlen (s) + 1); -#else print_aka (vp ? vp : s, list, 0); -#endif if (vp) free (vp); diff --git a/uip/inc.c b/uip/inc.c index 8716edd..07440b1 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -734,19 +734,6 @@ go_to_it: break; } -#if 0 - /* copy file from spool to tmp file */ - tmpfilenam = m_scratch ("", invo_name); - if ((fd = creat (tmpfilenam, m_gmprot ())) == NOTOK) - adios (tmpfilenam, "unable to create"); - chmod (tmpfilenam, m_gmprot ()); - if (!(in2 = fdopen (fd, "r+"))) - adios (tmpfilenam, "unable to access"); - cpymsg (in, in2); - - /* link message into folder */ - newmsg = folder_addmsg(mp, tmpfilenam); -#endif /* create scanline for new message */ switch (incerr = scan (in, msgnum + 1, msgnum + 1, nfs, width, msgnum == hghnum && chgflag, 1, NULL, 0L, noisy)) { @@ -975,39 +962,6 @@ go_to_it: } -#if 0 - -/* - * Copy message message from spool into - * temporary file. Massage the "From " line - * while copying. - */ - -cpymsg (FILE *in, FILE *out) -{ - int state; - char *tmpbuf, name[NAMESZ]; - - for (;;) { - state = m_getfld (state, name, tmpbuf, rlwidth, in); - switch (state) { - case FLD: - case FLDPLUS: - break; - case BODY: - break; - case LENERR: - case FMTERR: - break; - case FILEEOF: - break; - default: - } - } -} -#endif /* if 0 */ - - static void inc_done (int status) { diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 6a7443e..ec2c195 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -1549,11 +1549,6 @@ skip_headers: switch (ct->c_encoding) { case CE_7BIT: /* Nothing to output */ -#if 0 - np = add (ENCODING_FIELD, NULL); - vp = concat (" ", "7bit", "\n", NULL); - add_header (ct, np, vp); -#endif break; case CE_8BIT: diff --git a/uip/mhcachesbr.c b/uip/mhcachesbr.c index 2c18865..5f7777d 100644 --- a/uip/mhcachesbr.c +++ b/uip/mhcachesbr.c @@ -108,14 +108,6 @@ cache_content (CT ct) return; } -/* THIS NEEDS TO BE FIXED */ -#if 0 - if (ct->c_ceopenfnx == openMail) { - advise (NULL, "a radish may no know Greek, but I do..."); - return; - } -#endif - if (find_cache (NULL, wcachesw != CACHE_NEVER ? wcachesw : CACHE_ASK, &cachetype, ct->c_id, cachefile, sizeof(cachefile)) == NOTOK) { diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 80fc9eb..3b91eeb 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -1069,11 +1069,6 @@ show_external (CT ct, int serial, int alternate) return OK; return show_switch (p, serial, alternate); - -#if 0 - content_error (NULL, p, "don't know how to display content"); - return NOTOK; -#endif } diff --git a/uip/scan.c b/uip/scan.c index f49aa60..b22297f 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -261,14 +261,7 @@ main (int argc, char **argv) msgnum += (revflag ? -1 : 1)) { if (is_selected(mp, msgnum)) { if ((in = fopen (cp = m_name (msgnum), "r")) == NULL) { -#if 0 - if (errno != EACCES) -#endif admonish (cp, "unable to open message"); -#if 0 - else - printf ("%*d unreadable\n", DMAXFOLDER, msgnum); -#endif continue; } @@ -302,11 +295,7 @@ main (int argc, char **argv) adios (NULL, "scan() botch (%d)", state); case SCNEOF: -#if 0 - printf ("%*d empty\n", DMAXFOLDER, msgnum); -#else advise (NULL, "message %d: empty", msgnum); -#endif break; } hdrflag = 0; diff --git a/uip/slocal.c b/uip/slocal.c index a7283bf..869fa17 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -1044,18 +1044,6 @@ usr_folder (int fd, char *string) /* use rcvstore to put message in folder */ status = usr_pipe (fd, "rcvstore", rcvstoreproc, vec, 1); -#if 0 - /* - * Currently, verbose status messages are handled by usr_pipe(). - */ - if (verbose) { - if (status == 0) - verbose_printf (", success.\n"); - else - verbose_printf (", failed.\n"); - } -#endif - return status; } @@ -1277,13 +1265,6 @@ you_lose: /* get copy of envelope information ("From " line) */ envelope = getcpy (buffer); -#if 0 - /* First go ahead and put "From " line in message */ - fputs (buffer, ffp); - if (ferror (ffp)) - goto fputs_error; -#endif - /* Put the delivery date in message */ fputs (ddate, ffp); if (ferror (ffp)) -- 1.7.10.4