Re: [AD] patch for get_config_string

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



On Thu, 28 Dec 2000, Sven Sandberg wrote:

> > 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.

I suggested quotes (and even posted a patch) a while ago (around February
3). I did it, because I needed translation string beginning with spaces.
But Shawn replied it would break compatibility, because some translators
might used translation strings beginning with quote, which would be not
included then. I suggest it again, there could even be escape sequences in
there (like '\n'), which could be good.

As I see now, my patch was not correct, but that wasn't the reason why it
was discarded ;-)

To support quoted strings, changes should be made in
src/config.c:get_line() where are these lines:

       while ((c) && ((uisspace(c)) || (c == '='))) {
          i += uwidth(buf+i);
          c = ugetc(buf+i);
       }

       ustrcpy(val, buf+i);

       /* strip trailing spaces */
       i = ustrlen(val) - 1;
       while ((i >= 0) && (uisspace(ugetat(val, i))))
          usetat(val, i--, 0);


I don't know line numbers because I'm browsing CVS on Sourceforge and
unfortunately there is no such feature (as far as I can see).

Have a nice day.

Stepan Roh

P.S.: When I was browsing CVS tree on Sourceforge I noticed that perl/
subdir wasn't removed (but is empty).



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