소스 검색

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);