From: Ralph Corderoy Date: Mon, 21 Aug 2017 14:02:51 +0000 (+0100) Subject: Reformat else-if that are split over two or more lines into one. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/bf3160aa94f981374f0c6353344fd68a4e1daa12?hp=70637f3fad9cb3cbc6f4bd8d89a32bc474fc38ad Reformat else-if that are split over two or more lines into one. No functional change intended. --- diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index 6d883ea1..49a6b653 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -247,12 +247,10 @@ auxformat (struct mailname *mp, int extras) snprintf (buffer, sizeof(buffer), "%s <%s>", legal_person (mp->m_pers ? mp->m_pers : mp->m_mbox), addr); - } + } else if (mp->m_note) + snprintf (buffer, sizeof(buffer), "%s %s", addr, mp->m_note); else - if (mp->m_note) - snprintf (buffer, sizeof(buffer), "%s %s", addr, mp->m_note); - else - strncpy (buffer, addr, sizeof(buffer)); + strncpy (buffer, addr, sizeof(buffer)); return buffer; } diff --git a/sbr/path.c b/sbr/path.c index 3038df41..bf9283a3 100644 --- a/sbr/path.c +++ b/sbr/path.c @@ -78,9 +78,8 @@ expath (char *name, int flag) ep = pwds + strlen (pwds); if ((cp = strrchr(pwds, '/')) == NULL) cp = ep; - else - if (cp == pwds) - cp++; + else if (cp == pwds) + cp++; if (has_prefix(name, CWD)) name += LEN(CWD); diff --git a/uip/aliasbr.c b/uip/aliasbr.c index 7266c831..1376cad7 100644 --- a/uip/aliasbr.c +++ b/uip/aliasbr.c @@ -348,9 +348,8 @@ getalias (char *addrs) if (cp == NULL) cp = addrs; - else - if (*cp == 0) - return (cp = NULL); + else if (*cp == 0) + return (cp = NULL); /* Remove leading any space from the address. */ for (pp = cp; isspace ((unsigned char) *pp); pp++) diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index e16f31d9..00e1ef26 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -645,14 +645,12 @@ mhl_format (char *file, int length, int width) c1->c_nfs = mh_xstrdup(global.c_nfs); compile_formatfield(c1); } - } - else - if (c1->c_flags & ADDRFMT) { - if (global.c_flags & ADDRFMT) { - c1->c_nfs = mh_xstrdup(global.c_nfs); - compile_formatfield(c1); - } - } + } else if (c1->c_flags & ADDRFMT) { + if (global.c_flags & ADDRFMT) { + c1->c_nfs = mh_xstrdup(global.c_nfs); + compile_formatfield(c1); + } + } } continue; diff --git a/uip/mhparse.c b/uip/mhparse.c index 71405616..0eb474ae 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -2110,9 +2110,8 @@ openQuoted (CT ct, char **file) sizeof digest)) content_error (NULL, ct, "content integrity suspect (digest mismatch) -- continuing"); - else - if (debugsw) - fprintf (stderr, "content integrity confirmed\n"); + else if (debugsw) + fprintf (stderr, "content integrity confirmed\n"); } fseek (ce->ce_fp, 0L, SEEK_SET); @@ -2416,12 +2415,10 @@ openFile (CT ct, char **file) if (ferror (gp)) { admonish (ce->ce_file, "error reading"); (void) m_unlink (cachefile); - } - else - if (ferror (fp)) { - admonish (cachefile, "error writing"); - (void) m_unlink (cachefile); - } + } else if (ferror (fp)) { + admonish (cachefile, "error writing"); + (void) m_unlink (cachefile); + } fclose (fp); } umask (mask); @@ -2627,12 +2624,10 @@ openFTP (CT ct, char **file) if (ferror (gp)) { admonish (ce->ce_file, "error reading"); (void) m_unlink (cachefile); - } - else - if (ferror (fp)) { - admonish (cachefile, "error writing"); - (void) m_unlink (cachefile); - } + } else if (ferror (fp)) { + admonish (cachefile, "error writing"); + (void) m_unlink (cachefile); + } fclose (fp); } umask (mask); diff --git a/uip/post.c b/uip/post.c index 5f70e62f..d981ff62 100644 --- a/uip/post.c +++ b/uip/post.c @@ -990,9 +990,8 @@ putfmt (char *name, char *str, int *eai, FILE *out) mp->m_bcc++; if (np->m_ingrp) mp->m_ingrp = np->m_ingrp; - else - if (mp->m_gname) - putgrp (namep, mp->m_gname, out, hdr->flags); + else if (mp->m_gname) + putgrp (namep, mp->m_gname, out, hdr->flags); if (mp->m_ingrp) { if (sm_mts == MTS_SENDMAIL_PIPE) { /* Catch this before sendmail chokes with: @@ -1495,11 +1494,10 @@ make_bcc_file (int dashstuff) while (find_prefix () == NOTOK) { if (*cp < 'z') (*cp)++; - else - if (*++cp == 0) - adios (NULL, "can't find a unique delimiter string"); - else - (*cp)++; + else if (*++cp == 0) + adios (NULL, "can't find a unique delimiter string"); + else + (*cp)++; } fprintf (out, "%s: %s\n%s: multipart/digest; boundary=\"", diff --git a/uip/sendsbr.c b/uip/sendsbr.c index 796b58ea..41060100 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -592,9 +592,8 @@ tmp_fd (void) if (debugsw) inform("temporary file %s selected", tfile); - else - if (m_unlink (tfile) == NOTOK) - advise (tfile, "unable to remove"); + else if (m_unlink (tfile) == NOTOK) + advise (tfile, "unable to remove"); return fd; } diff --git a/uip/slocal.c b/uip/slocal.c index bf58fd0b..b249dc4b 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -1118,11 +1118,10 @@ usr_pipe (int fd_arg, char *cmd, char *pgm, char **vec, int suppress) if (verbose) { if (status == 0) verbose_printf (", success.\n"); - else - if ((status & 0xff00) == 0xff00) - verbose_printf (", system error\n"); - else - pidstatus (status, stdout, ", failed"); + else if ((status & 0xff00) == 0xff00) + verbose_printf (", system error\n"); + else + pidstatus (status, stdout, ", failed"); } return (status == 0 ? 0 : -1); }