Print this page
6139 help gcc figure out variable initialization
@@ -461,17 +461,16 @@
if ((node->hp_type == HP_NODE_CONNECTOR) ||
(node->hp_type == HP_NODE_PORT))
(void) strlcpy(connection, node->hp_name, MAXPATHLEN);
/* Trace back to the root node, accumulating components */
- for (parent = node; parent != NULL; parent = parent->hp_parent) {
+ for (parent = node, root = parent; parent != NULL;
+ root = parent, parent = parent->hp_parent) {
if (parent->hp_type == HP_NODE_DEVICE) {
(void) strlcat(components, "/", MAXPATHLEN);
(void) strlcat(components, parent->hp_name, MAXPATHLEN);
}
- if (parent->hp_parent == NULL)
- root = parent;
}
/* Ensure the snapshot actually contains a base path */
if (root->hp_basepath == NULL) {
i_hp_dprintf("hp_path: missing base pathname.\n");