Parcourir la source

[Settings] find_child_settings() accepts a NULL parent

tags/v0.9.4
Michael Brown il y a 16 ans
Parent
révision
af466aedf1
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4
    0
      src/core/settings.c

+ 4
- 0
src/core/settings.c Voir le fichier

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

Chargement…
Annuler
Enregistrer