]> diplodocus.org Git - nmh/commitdiff
ext_hook(): Flip if-statement condition so then-block simply returns.
authorRalph Corderoy <ralph@inputplus.co.uk>
Wed, 13 Sep 2017 22:16:50 +0000 (23:16 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Wed, 13 Sep 2017 22:16:50 +0000 (23:16 +0100)
No need for rest of function to be in an else-block.

sbr/ext_hook.c

index 3cde1fd..f1a9a14 100644 (file)
@@ -46,20 +46,20 @@ ext_hook(char *hook_name, char *message_file_name_1, char *message_file_name_2)
        break;
     }
 
        break;
     }
 
-    if (status != OK) {
-       if (did_message == 0) {
-           char *msghook;
-           if ((msghook = context_find("msg-hook")) != NULL)
-                inform("%s", msghook);
-           else {
-               char errbuf[BUFSIZ];
-               snprintf(errbuf, sizeof(errbuf), "external hook \"%s\"", hook);
-               pidstatus(status, stderr, errbuf);
-           }
-           did_message = 1;
-       }
-
-       return NOTOK;
-    } else
+    if (status == OK)
        return OK;
        return OK;
+
+    if (did_message == 0) {
+        char *msghook;
+        if ((msghook = context_find("msg-hook")) != NULL)
+            inform("%s", msghook);
+        else {
+            char errbuf[BUFSIZ];
+            snprintf(errbuf, sizeof(errbuf), "external hook \"%s\"", hook);
+            pidstatus(status, stderr, errbuf);
+        }
+        did_message = 1;
+    }
+
+    return NOTOK;
 }
 }