Parse a field's "enum=" correctly
Compare changes
Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
In xv.xml, there is something like this:
<struct name="ImageFormatInfo">
[...]
<field type="CARD8" name="byte_order" enum="ImageOrder" />
<pad bytes="2" />
<list type="CARD8" name="guid">
<value>16</value>
</list>
[...]
</struct>
When parsing this, the Field instance for "guid" ended up with .enum == "ImageOrder". This is because the loop that parses complex type did not unset a variable across iterations, meaning that the last "enum" property "stuck" and was also used for all following fields.
Fix this by simply moving the initialisation of the "enum" variable inside of the loop.
Signed-off-by: Uli Schlachter psychon@znc.in