mirror of
https://github.com/schoebel/mars
synced 2025-04-27 21:58:20 +00:00
main: restrict table searching to subdir entries
This commit is contained in:
parent
f65d18ddf5
commit
114d9748ad
@ -6499,6 +6499,8 @@ int main_checker(struct mars_dent *parent,
|
|||||||
int *serial,
|
int *serial,
|
||||||
bool *use_channel)
|
bool *use_channel)
|
||||||
{
|
{
|
||||||
|
int parent_class;
|
||||||
|
int start_class;
|
||||||
int class;
|
int class;
|
||||||
int status = -2;
|
int status = -2;
|
||||||
#ifdef MARS_DEBUGGING
|
#ifdef MARS_DEBUGGING
|
||||||
@ -6509,13 +6511,20 @@ int main_checker(struct mars_dent *parent,
|
|||||||
const char *name = _name;
|
const char *name = _name;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (class = CL_ROOT + 1; ; class++) {
|
parent_class = CL_ROOT;
|
||||||
|
if (parent)
|
||||||
|
parent_class = parent->d_class;
|
||||||
|
start_class = main_classes[parent_class].cl_childs;
|
||||||
|
for (class = start_class; ; class++) {
|
||||||
const struct main_class *test = &main_classes[class];
|
const struct main_class *test = &main_classes[class];
|
||||||
int len = test->cl_len;
|
int len = test->cl_len;
|
||||||
|
|
||||||
if (!test->cl_name) { // end of table
|
/* end of subdir */
|
||||||
|
if (test->cl_father != parent_class)
|
||||||
|
break;
|
||||||
|
/* end of table */
|
||||||
|
if (!test->cl_name)
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MARS_DEBUGGING
|
#ifdef MARS_DEBUGGING
|
||||||
/* This can only happen when the table stucture is misformed.
|
/* This can only happen when the table stucture is misformed.
|
||||||
|
Loading…
Reference in New Issue
Block a user