Original diff from lux (lx [at] shellcodes [dot] org) thanks!
tweaked by me; ok millert@
-/* $OpenBSD: region.c,v 1.42 2023/03/27 17:54:20 op Exp $ */
+/* $OpenBSD: region.c,v 1.43 2023/03/28 08:01:40 op Exp $ */
/* This file is in the public domain. */
#include <sys/wait.h>
#include <errno.h>
#include <fcntl.h>
+#include <paths.h>
#include <poll.h>
#include <signal.h>
#include <stdio.h>
return (FALSE);
}
- shellp = getenv("SHELL");
+ if ((shellp = getenv("SHELL")) == NULL)
+ shellp = _PATH_BSHELL;
ret = pipeio(shellp, argv, text, len, bp);
_exit(1);
if (dup2(s[1], STDERR_FILENO) == -1)
_exit(1);
- if (path == NULL)
- _exit(1);
execv(path, argv);
err = strerror(errno);