$OpenBSD: patch-src_script_c,v 1.2 2019/03/27 23:47:21 sthen Exp $

From f17480d3e1e914d03fea0c054a028fe979742950 Mon Sep 17 00:00:00 2001
From: Roy Marples <roy@marples.name>
Date: Mon, 25 Mar 2019 12:17:07 +0000
Subject: script: Fix not running when empty string or /dev/null

From 97bb60296dc42a29a054ebf9347ac31a7d787393 Mon Sep 17 00:00:00 2001
From: Roy Marples <roy@marples.name>
Date: Mon, 25 Mar 2019 12:20:45 +0000
Subject: script: Fix prior when we have listeners but no script

Index: src/script.c
--- src/script.c.orig
+++ src/script.c
@@ -704,9 +704,7 @@ script_runreason(const struct interface *ifp, const ch
 	int status = 0;
 	struct fd_list *fd;
 
-	if (ifp->options->script &&
-	    (ifp->options->script[0] == '\0' ||
-	    strcmp(ifp->options->script, "/dev/null") == 0) &&
+	if (ifp->options->script == NULL &&
 	    TAILQ_FIRST(&ifp->ctx->control_fds) == NULL)
 		return 0;
 
@@ -717,9 +715,7 @@ script_runreason(const struct interface *ifp, const ch
 		return -1;
 	}
 
-	if (ifp->options->script &&
-	    (ifp->options->script[0] == '\0' ||
-	    strcmp(ifp->options->script, "/dev/null") == 0))
+	if (ifp->options->script == NULL)
 		goto send_listeners;
 
 	argv[0] = ifp->options->script ? ifp->options->script : UNCONST(SCRIPT);
