Re: [AD] patch for config.c |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Sat, 2004-10-30 at 22:37 -0300, David A. Capello wrote:
> With this patch the configuration routines will try to set variables
> in the config_override file first (if it's open), if not, it will use
> the current Allegro configuration file.
>
> This is useful to make an override_config_file("myfile.cfg") at the
> beginning of your program without use pop/push config states everytime
> you want to set a variable.
>
> The override_config_file(NULL) closes the config_override file (this
> should be documented).
>
I didn't try the patch yet - but this makes sense to me.
The docs for override_config_file say:
"Specifies a file containing config overrides. These settings will be
used in addition to the parameters in the main config file, and where a
variable is present in both files this version will take priority."
And the docs for flush_config_file:
"Writes the current config file to disk if the contents have changed
since it was loaded or since the latest call to the function."
It nowhere says that the override file only takes priority for reading -
so actually, it should already have worked like your patch makes it.
--
Elias Pschernig