After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 349552 - problem with parsing (enum) style properties
problem with parsing (enum) style properties
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.10.x
Other All
: High critical
: ---
Assigned To: gtk-bugs
gtk-bugs
: 348909 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-08-01 15:59 UTC by Benjamin Berg
Modified: 2011-02-04 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch fixing the bug (1.67 KB, patch)
2006-08-03 10:36 UTC, Michael Natterer
none Details | Review
Same uglyness, larger patch :) (4.54 KB, patch)
2006-08-03 12:31 UTC, Michael Natterer
none Details | Review

Description Benjamin Berg 2006-08-01 15:59:48 UTC
The following gtkrc will throw a parser error with cvs head.

style "asdf"
{
    GtkMenuItem::selected_shadow_type = GTK_SHADOW_IN
    xthickness = 2
}

mitch says it is his fault :-)
Comment 1 Michael Natterer 2006-08-03 10:36:41 UTC
Created attachment 70122 [details] [review]
Patch fixing the bug

This is ugly, but I don't see another way to fix the bug (except adding
an unget facility to GScanner, which won't help us now either).
Comment 2 Matthias Clasen 2006-08-03 12:08:21 UTC
Ugh indeed. 
Can we at least store the configuration in some local variables and
restore it to the previous values, rather than hardcode magic configuration values there ?
Comment 3 Michael Natterer 2006-08-03 12:31:19 UTC
Created attachment 70128 [details] [review]
Same uglyness, larger patch :)
Comment 4 Matthias Clasen 2006-08-03 12:44:37 UTC
Maybe add a little "FIXME - we need g_scanner_unget(), see bug #..."
in the comment. Other than that, looks ok
Comment 5 Michael Natterer 2006-08-03 14:08:28 UTC
FIXME added, fixed in CVS:

2006-08-03  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkrc.c (gtk_rc_parse_assignment): reset scanner config to
	default values while checking if an expression(foobar) follows,
	because if no expression follows the scanner's "next token" must
	be usable for the caller of this function (fixes bug #349552).
Comment 6 Matthias Clasen 2006-08-05 18:30:16 UTC
*** Bug 348909 has been marked as a duplicate of this bug. ***