aboutsummaryrefslogtreecommitdiff
path: root/cmd-set-option.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-03-17 12:01:28 +0000
committerThomas Adam <thomas@xteddy.org>2020-03-17 12:01:28 +0000
commit0610f66fa9c8e5ac46e796a2dbc89bb1b369d84f (patch)
tree5a1203bc453a07be05a2c652e635570adb8ee672 /cmd-set-option.c
parent71eb965dd9ef1e511dfb6d2b24196cca550e1284 (diff)
parent115bb33257ece9eec1c890cc04683227678a895f (diff)
downloadrtmux-0610f66fa9c8e5ac46e796a2dbc89bb1b369d84f.tar.gz
rtmux-0610f66fa9c8e5ac46e796a2dbc89bb1b369d84f.tar.bz2
rtmux-0610f66fa9c8e5ac46e796a2dbc89bb1b369d84f.zip
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r--cmd-set-option.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c
index 23b45230..2709dcdc 100644
--- a/cmd-set-option.c
+++ b/cmd-set-option.c
@@ -309,6 +309,13 @@ cmd_set_option_set(struct cmd *self, struct cmdq_item *item, struct options *oo,
old = xstrdup(options_get_string(oo, oe->name));
options_set_string(oo, oe->name, append, "%s", value);
new = options_get_string(oo, oe->name);
+ if (strcmp(oe->name, "default-shell") == 0 &&
+ !checkshell(new)) {
+ options_set_string(oo, oe->name, 0, "%s", old);
+ free(old);
+ cmdq_error(item, "not a suitable shell: %s", value);
+ return (-1);
+ }
if (oe->pattern != NULL && fnmatch(oe->pattern, new, 0) != 0) {
options_set_string(oo, oe->name, 0, "%s", old);
free(old);