Explorar o código

Check for context type for nav() symbol

Serj Kalichev %!s(int64=3) %!d(string=hai) anos
pai
achega
2dfdb21fd4
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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);