Переглянути джерело

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

Завантаження…
Відмінити
Зберегти