Fix comments in TEXT section
authorPavel Labath <pavelo@centrum.sk>
Tue, 9 Jun 2009 15:21:40 +0000 (17:21 +0200)
committerBrenden Matthews <brenden@rty.ca>
Tue, 9 Jun 2009 20:56:19 +0000 (14:56 -0600)
commit6586d47813c9b3d1884dce39cd96331069b1c4f4
treedd2f8b9e4079158e10b70259d2ef0463c1991155
parentf3aa025872fcc07881e5e976c0c454b6480ec517
Fix comments in TEXT section

When a '#' is found in TEXT, section remove_comments() is called.  However, that function doesn't
limit itself to removing that particular comment. Instead, it greedily removes all "comments" from
the string, including those in ${color $abcdef} constructs. This, obviously, makes a mess of
things.

Solution: I added a new function, remove_comment(), that only removes the current comment.

Note: Atm, the function doesn't delete the newline, since that was the current behavior, and is
the natural one for the config section. However, for the TEXT it seems better to delete the \n
too, to avoid blank lines.

Note2: this also fixes the bug in strfold(), which incorectly copied the string, truncating it by
one byte.

Signed-off-by: Brenden Matthews <brenden@rty.ca>
src/conky.c