瀏覽代碼

[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…
取消
儲存