Re: [AD] patch for get_config_string

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Eduard Bloch wrote:
> Really? How do you set an empty string? There is still one or more
> spaces after the =. 

But these are stripped out (see config.c, get_line(), inside the 
`if (j)' block). So any config variable consisting of only whitespace is
treated as an empty string.

> Look, the allegro.cfg file distributed with
> Allegro contains examples that are not commented out! With these
> defaults Allegro use allways empty strings instead of defaults.

Ah, that's true. I didn't know this. AFAICS Allegro does the "empty
string -> default" conversion manually each time it uses the config
routines. So the issue is wether the config routines should take care of
the conversion (as in your patch) or if the user of the config routines
(a user program or some other part of Allegro) should do that. You may
be right that it would be consistent to force anyone who uses the config
routines to do it the same way as Allegro. OK, use the patch then!

> IMHO it's also not possible to specify empty strings now, so what is
> the problem? If you want this "feature", we could introduce something
> new to specify empty strings, e.g. using "" to do so.

Supporting quotes sounds like a good idea. Then you can set the empty
string as a special case, but it also allows to set some other values
that were not possible before, eg. text beginning with space (which is
probably more commonly needed). I don't need any of this right now
though, so I'd be happy if we didn't implement it until someone really
asks for it.

Sven



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/