mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-13 23:38:52 +02:00
We cannot do hooks_find and then hooks_remove because it might have come
from the parent (global) tree, instead make it remove by name like options. While here, also tidy up a few bits of options and hooks handling (use RB_FOREACH_SAFE, and a helper function for the free).
This commit is contained in:
@ -93,8 +93,7 @@ cmd_set_hook_exec(struct cmd *self, struct cmd_q *cmdq)
|
||||
name);
|
||||
return (CMD_RETURN_ERROR);
|
||||
}
|
||||
if ((hook = hooks_find(hooks, name)) != NULL)
|
||||
hooks_remove(hooks, hook);
|
||||
hooks_remove(hooks, name);
|
||||
return (CMD_RETURN_NORMAL);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user