Browse Source

[Settings] Bugfix: store_setting() now applies changes even on root block

tags/v0.9.4
Michael Brown 17 years ago
parent
commit
65c0974d1f
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      src/core/settings.c

+ 2
- 3
src/core/settings.c View File

299
  */
299
  */
300
 int store_setting ( struct settings *settings, unsigned int tag,
300
 int store_setting ( struct settings *settings, unsigned int tag,
301
 		    const void *data, size_t len ) {
301
 		    const void *data, size_t len ) {
302
-	struct settings *parent;
303
 	int rc;
302
 	int rc;
304
 
303
 
305
 	/* Sanity check */
304
 	/* Sanity check */
317
 	/* If these settings are registered, apply potentially-updated
316
 	/* If these settings are registered, apply potentially-updated
318
 	 * settings
317
 	 * settings
319
 	 */
318
 	 */
320
-	for ( parent = settings->parent ; parent ; parent = parent->parent ) {
321
-		if ( parent == &settings_root ) {
319
+	for ( ; settings ; settings = settings->parent ) {
320
+		if ( settings == &settings_root ) {
322
 			if ( ( rc = apply_settings() ) != 0 )
321
 			if ( ( rc = apply_settings() ) != 0 )
323
 				return rc;
322
 				return rc;
324
 			break;
323
 			break;

Loading…
Cancel
Save