浏览代码

Check for context type for nav() symbol

Serj Kalichev 3 年之前
父节点
当前提交
2dfdb21fd4
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      plugins/klish/nav.c

+ 4 - 0
plugins/klish/nav.c

@@ -36,6 +36,10 @@ int klish_nav(kcontext_t *context)
 	const char *value = NULL;
 	const char *command_name = NULL;
 
+	// Navigation is suitable only for command actions but not for
+	// PTYPEs, CONDitions i.e. SERVICE_ACTIONS.
+	assert(kcontext_type(context) == KCONTEXT_ACTION);
+
 	parg = kcontext_candidate_parg(context);
 	entry = kparg_entry(parg);
 	value = kparg_value(parg);