From: Ralph Corderoy Date: Wed, 23 Aug 2017 21:16:32 +0000 (+0100) Subject: Flip logic, moving goto from else- to then-block. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/7d57ffc92fe378f7a445a841609adba86bcef0b3?ds=inline Flip logic, moving goto from else- to then-block. Thus removing the need for the `else'. --- diff --git a/uip/install-mh.c b/uip/install-mh.c index 61853195..414a4877 100644 --- a/uip/install-mh.c +++ b/uip/install-mh.c @@ -128,16 +128,13 @@ main (int argc, char **argv) cp = concat (mypath, "/", "Mail", NULL); if (stat (cp, &st) != NOTOK) { - if (S_ISDIR(st.st_mode)) { - cp = concat ("You already have the standard nmh directory \"", - cp, "\".\nDo you want to use it for nmh? ", NULL); - if (read_switch (cp, anoyes)) - pathname = "Mail"; - else - goto query; - } else { + if (!S_ISDIR(st.st_mode)) goto query; - } + cp = concat ("You already have the standard nmh directory \"", + cp, "\".\nDo you want to use it for nmh? ", NULL); + if (!read_switch (cp, anoyes)) + goto query; + pathname = "Mail"; } else { if (autof) puts("I'm going to create the standard nmh path for you."); diff --git a/uip/mhparse.c b/uip/mhparse.c index 4a031b0e..4b5d16be 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -1841,7 +1841,10 @@ openBase64 (CT ct, char **file) *cp = '\0'; if (decodeBase64 (buffer, &decoded, &decoded_len, ct->c_type == CT_TEXT, - ct->c_digested ? digest : NULL) == OK) { + ct->c_digested ? digest : NULL) != OK) + goto clean_up; + + { size_t i; unsigned char *decoded_p = decoded; for (i = 0; i < decoded_len; ++i) { @@ -1864,8 +1867,6 @@ openBase64 (CT ct, char **file) } } } - } else { - goto clean_up; } fseek (ct->c_fp, 0L, SEEK_SET);