Bug fix: iso_node_get_name() of root node returned NULL pointer rather than

an empty string
release-1.5.4.branch
Thomas Schmitt 7 years ago
parent 395128ef5f
commit 218e26c974
  1. 4
      libisofs/libisofs.h
  2. 4
      libisofs/node.c

@ -4768,6 +4768,10 @@ int iso_node_set_name(IsoNode *node, const char *name);
* The returned string belongs to the node and must not be modified nor
* freed. Use strdup if you really need your own copy.
*
* Up to version 1.4.2 inquiry of the root directory name returned NULL,
* which is a bug in the light of above description.
* Since 1.4.2 the return value is an empty string.
*
* @since 0.6.2
*/
const char *iso_node_get_name(const IsoNode *node);

@ -414,6 +414,10 @@ int iso_image_set_node_name(IsoImage *image, IsoNode *node, const char *name,
*/
const char *iso_node_get_name(const IsoNode *node)
{
static char *root = {""};
if (node->name == NULL)
return root;
return node->name;
}

Loading…
Cancel
Save