Cairo-Dock / cairo-dock-core

Core part of Cairo-Dock project.
http://glx-dock.org
GNU General Public License v3.0
186 stars 46 forks source link

Help: remove leading whitespace from comment #19

Closed mtasaka closed 4 months ago

mtasaka commented 4 months ago

A. In _cairo_dock_get_next_tip() (or _cairo_dock_get_previous_tip()), g_key_file_get_comment() is called to retrieve comment. According to the specification: https://docs.gtk.org/glib/method.KeyFile.get_comment.html The above call does not remove the leading whitespace ('#' comment marker is removed). So currently due to the leading newline, currently *cKeyComment == CAIRO_DOCK_WIDGET_EXPANDER never matches, so currently _cairo_dock_get_next_tip() causes infinite loop.

So skip reading whitespace, as this is shown in cairo_dock_parse_key_comment().

B. The buffer returned by g_key_file_get_comment() must be handled by g_free in _cairo_dock_get_previous_tip() (as _cairo_dock_get_next_tip() already does).

dkondor commented 4 months ago

Hi, this should be fixed by #16 that I just merged (you can also check by viewing the "web editor" above with the conflicts that we did almost the same changes :)) -- but it would be great if you could also test it. Thanks!

mtasaka commented 4 months ago

This can be closed. Closing.