|
list_config_sections not working correctly and section name problem |
spellcaster
Member #1,493
September 2001
|
Hiho! If you take the example program for list_config_entries
and feed it with a config file like this: value0=foo value1=bar You won't see anything since the "global" section is not returned at all. I'd suggest to return global settings belonging to a section named "" or a NULL pointer. Also, if use a section name that contains a space, the section will not be loaded at all. This should either be pointed out in the documentation or changed in the implementation. -- |
Elias
Member #358
May 2000
|
Quote: If you take the example program for list_config_entries and feed it with a config file like this: value0=foo You won't see anything since the "global" section is not returned at all. I'd suggest to return global settings belonging to a section named "" or a NULL pointer. Another way to fix it would be if the example would first use list_config_entries to get all global entries, and only then loop through the sections. This would not require code changes, just modifying the example. Quote: Also, if use a section name that contains a space, the section will not be loaded at all. This should either be pointed out in the documentation or changed in the implementation. That's not specific to list_config_sections though. -- |
CGamesPlay
Member #2,559
July 2002
|
Elias: I remember telling you about the bug in that example (where free_config_sections is called outside the loop where it should be called)... Was this fix only in SVN? -- Ryan Patterson - <http://cgamesplay.com/> |
Elias
Member #358
May 2000
|
It should work like that, as it uses realloc internally - so it's enough to free it outside. You fixed something else though: Quote: r7812 | elias | 2007-04-04 15:11:04 +0200 (Wed, 04 Apr 2007) | 1 line Ryan Patterson fixed a crash in free_config_entries.
-- |
spellcaster
Member #1,493
September 2001
|
Quote: That's not specific to list_config_sections though. Yep, that's why I specified two problems in the topic name Quote: this would not require code changes, just modifying the example. That might be an idea as well -- |
Elias
Member #358
May 2000
|
Quote: Yep, that's why I specified two problems in the topic name Ah, so you expected me to read the topic Quote: That might be an idea as well
Quote:
------------------------------------------------------------------------ Fixed two problems pointed out by spellcaster on allegro.cc: ------------------------------------------------------------------------
-- |
|