fixed linktable traversal
This commit is contained in:
parent
83f88dbe38
commit
4b2ac94fe1
10
src/link.c
10
src/link.c
|
@ -602,7 +602,7 @@ LinkTable *path_to_Link_LinkTable_new(const char *path)
|
||||||
{
|
{
|
||||||
Link *link = path_to_Link(path);
|
Link *link = path_to_Link(path);
|
||||||
LinkTable *next_table = link->next_table;
|
LinkTable *next_table = link->next_table;
|
||||||
if (next_table) {
|
if (!next_table) {
|
||||||
if (!CONFIG.sonic_mode) {
|
if (!CONFIG.sonic_mode) {
|
||||||
next_table = LinkTable_new(link->f_url);
|
next_table = LinkTable_new(link->f_url);
|
||||||
} else {
|
} else {
|
||||||
|
@ -613,7 +613,8 @@ LinkTable *path_to_Link_LinkTable_new(const char *path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return link->next_table;
|
link->next_table = next_table;
|
||||||
|
return next_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Link *path_to_Link_recursive(char *path, LinkTable *linktbl)
|
static Link *path_to_Link_recursive(char *path, LinkTable *linktbl)
|
||||||
|
@ -629,7 +630,6 @@ static Link *path_to_Link_recursive(char *path, LinkTable *linktbl)
|
||||||
*slash = '\0';
|
*slash = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
puts(path);
|
|
||||||
slash = strchr(path, '/');
|
slash = strchr(path, '/');
|
||||||
if ( slash == NULL ) {
|
if ( slash == NULL ) {
|
||||||
/* We cannot find another '/', we have reached the last level */
|
/* We cannot find another '/', we have reached the last level */
|
||||||
|
@ -670,8 +670,8 @@ static Link *path_to_Link_recursive(char *path, LinkTable *linktbl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return path_to_Link_recursive(
|
linktbl->links[i]->next_table = next_table;
|
||||||
next_path, linktbl->links[i]->next_table);
|
return path_to_Link_recursive(next_path, next_table);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue