diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index a483dff..d2cab73 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -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); diff --git a/libisofs/node.c b/libisofs/node.c index ca68436..4bb2f7d 100644 --- a/libisofs/node.c +++ b/libisofs/node.c @@ -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; }