]> diplodocus.org Git - nmh/commitdiff
Flip logic, moving goto from else- to then-block.
authorRalph Corderoy <ralph@inputplus.co.uk>
Wed, 23 Aug 2017 21:16:32 +0000 (22:16 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Wed, 23 Aug 2017 22:31:42 +0000 (23:31 +0100)
Thus removing the need for the `else'.

uip/install-mh.c
uip/mhparse.c

index 6185319..414a487 100644 (file)
@@ -128,16 +128,13 @@ main (int argc, char **argv)
 
     cp = concat (mypath, "/", "Mail", NULL);
     if (stat (cp, &st) != NOTOK) {
 
     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;
            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.");
     } else {
        if (autof)
            puts("I'm going to create the standard nmh path for you.");
index 4a031b0..4b5d16b 100644 (file)
@@ -1841,7 +1841,10 @@ openBase64 (CT ct, char **file)
     *cp = '\0';
 
     if (decodeBase64 (buffer, &decoded, &decoded_len, ct->c_type == CT_TEXT,
     *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) {
         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);
     }
 
     fseek (ct->c_fp, 0L, SEEK_SET);