소스 검색

[Settings] find_child_settings() accepts a NULL parent

tags/v0.9.4
Michael Brown 16 년 전
부모
커밋
af466aedf1
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4
    0
      src/core/settings.c

+ 4
- 0
src/core/settings.c 파일 보기

@@ -233,6 +233,10 @@ struct settings * find_child_settings ( struct settings *parent,
233 233
 	struct settings *settings;
234 234
 	size_t len;
235 235
 
236
+	/* NULL parent => add to settings root */
237
+	if ( parent == NULL )
238
+		parent = &settings_root;
239
+
236 240
 	/* Look for a child whose name matches the initial component */
237 241
 	list_for_each_entry ( settings, &parent->children, siblings ) {
238 242
 		len = strlen ( settings->name );

Loading…
취소
저장