XBEL bug 761: Distinguish between names and values of attributes.
commita82a5cc6d5aecc4788394cfe1c9b8bd2670a759e
authorKalle Olavi Niemitalo <kon@iki.fi>
Sun, 11 Jun 2006 12:08:00 +0000 (11 15:08 +0300)
committerKalle Olavi Niemitalo <Kalle@Astalo.kon.iki.fi>
Sun, 4 Jan 2009 13:15:21 +0000 (4 15:15 +0200)
tree2a1fa06d420fab6b44264df791f3ebbd4f43079b
parent30dbe6a2f8f92aa2cc7bbc4d63aa1a53445691df
XBEL bug 761: Distinguish between names and values of attributes.

When ELinks is parsing an XML element in from an XBEL bookmark file,
it collects the attributes of the element to the current_node->attrs
list.  Previously, struct attributes had room for one string only:
the last element of current_node->attrs was the name of the first
attribute, and it was preceded by the value of the first attribute,
the name of the second attribute, the value of the second attribute,
and so on.  However, when get_attribute_value() was looking for a
given name, it compared the values as well.  So, if you had for
example <bookmark id="href" href="http://elinks.cz/">, then
get_attribute_value("href") would incorrectly return "href".

To fix this confusion, store values in the new member
attributes.value, rather than in attributes.name.
src/bookmarks/backend/xbel.c