mirror of
https://github.com/vivier/EMILE.git
synced 2024-12-23 01:29:34 +00:00
check case when index_name is NULL
This commit is contained in:
parent
37d9728374
commit
0319bb29f2
@ -15,23 +15,27 @@ int config_find_indexed_property(char *configuration, char *index_name, char *in
|
|||||||
int last_index;
|
int last_index;
|
||||||
char current_name[256];
|
char current_name[256];
|
||||||
|
|
||||||
index = config_find_entry(configuration, index_name, index_property);
|
if (index_name == NULL)
|
||||||
if (index == -1)
|
index = 0;
|
||||||
return -1;
|
else
|
||||||
while (configuration[index])
|
index = config_find_entry(configuration, index_name, index_property);
|
||||||
|
|
||||||
|
while ((index != -1) && configuration[index])
|
||||||
{
|
{
|
||||||
last_index = index;
|
last_index = index;
|
||||||
index = config_get_next_property(configuration, index,
|
index = config_get_next_property(configuration, index,
|
||||||
current_name, property);
|
current_name, property);
|
||||||
if (index == -1)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (strcmp(name, current_name) == 0)
|
if ((name != NULL) && strcmp(name, current_name) == 0)
|
||||||
return last_index;
|
return last_index;
|
||||||
|
|
||||||
if ((index_name != NULL) &&
|
if ((index_name != NULL) &&
|
||||||
(strcmp(index_name, current_name) == 0))
|
(strcmp(index_name, current_name) == 0))
|
||||||
|
{
|
||||||
|
if (name == NULL)
|
||||||
|
return last_index;
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user