- Only include the whole_word parameter when DISABLE_SPELLER
isn't defined, as it's only used then. (DLR)
- text.c:
+ execute_command()
+ - Instead of hardcoding /bin/sh as the shell to use when
+ executing a command, use $SHELL, and only fall back to /bin/sh
+ if $SHELL isn't set. (DLR)
do_wrap()
- Rename variable wrapping to prepending, to avoid confusion,
and rename the static bool same_line_wrap to prepend_wrap to
/* Fork a child. */
if ((pid = fork()) == 0) {
+ char *shellenv;
+
close(fd[0]);
dup2(fd[1], fileno(stdout));
dup2(fd[1], fileno(stderr));
+ /* Check $SHELL for the shell to use. If it isn't set, use
+ * /bin/sh. */
+ shellenv = getenv("SHELL");
+ if (shellenv == NULL)
+ shellenv = "/bin/sh";
+
/* If execl() returns at all, there was an error. */
- execl("/bin/sh", "sh", "-c", command, NULL);
+ execl(shellenv, tail(shellenv), "-c", command, NULL);
exit(0);
}