summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-10-29 19:41:41 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-10-29 20:03:31 +0200
commit568f9b712308befd337c387b3f129b8f73715993 (patch)
treeaa82a3ba1dcb10e89b576eeadb9f16df62c426d8 /degesch.c
parent0d499dd125d97061e120187fd59d00c18d77b198 (diff)
downloadxK-568f9b712308befd337c387b3f129b8f73715993.tar.gz
xK-568f9b712308befd337c387b3f129b8f73715993.tar.xz
xK-568f9b712308befd337c387b3f129b8f73715993.zip
degesch: tiny fixes for the prompt hookcoverity_scan
It should return valid UTF-8. Also remember to refresh the prompt upon hook removal.
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/degesch.c b/degesch.c
index 62d47d7..34d3557 100644
--- a/degesch.c
+++ b/degesch.c
@@ -8796,6 +8796,7 @@ lua_hook_unhook (lua_State *L)
break;
case XLUA_HOOK_PROMPT:
LIST_UNLINK (hook->plugin->ctx->prompt_hooks, &hook->data.hook);
+ refresh_prompt (hook->plugin->ctx);
break;
case XLUA_HOOK_COMPLETION:
LIST_UNLINK (hook->plugin->ctx->completion_hooks, &hook->data.hook);
@@ -8892,11 +8893,11 @@ lua_prompt_hook_make (struct prompt_hook *self)
char *prompt = xstrdup ("");
if (lua_plugin_call (plugin, 1, 1, &e))
{
- lua_plugin_handle_string_filter_result (plugin, &prompt, false, &e);
+ lua_plugin_handle_string_filter_result (plugin, &prompt, true, &e);
lua_pop (L, 1);
}
if (e)
- lua_plugin_log_error (plugin, "Prompt hook", e);
+ lua_plugin_log_error (plugin, "prompt hook", e);
return prompt;
}