//read clear
VTOY_JSON_FMT_SINT("syntax_error", g_sysinfo.syntax_error);
g_sysinfo.syntax_error = 0;
+
+ VTOY_JSON_FMT_SINT("invalid_config", g_sysinfo.invalid_config);
+ g_sysinfo.invalid_config = 0;
#if defined(_MSC_VER) || defined(WIN32)
{
memset(data, 0, sizeof(data_control));
+ data->default_menu_mode = 1;
data->filter_dot_underscore = 1;
+ data->treeview_style = 1;
data->max_search_level = -1;
data->menu_timeout = 0;
unsigned char *start = NULL;
VTOY_JSON *json = NULL;
VTOY_JSON *node = NULL;
+ VTOY_JSON *next = NULL;
ret = ventoy_read_file_to_buf(filename, 4, (void **)&buffer, &buflen);
if (ret)
{
vlog("parse ventoy.json success\n");
+ for (node = json->pstChild; node; node = node->pstNext)
+ for (next = node->pstNext; next; next = next->pstNext)
+ {
+ if (node->pcName && next->pcName && strcmp(node->pcName, next->pcName) == 0)
+ {
+ vlog("ventoy.json contains duplicate key <%s>.\n", node->pcName);
+ g_sysinfo.invalid_config = 1;
+ ret = 1;
+ goto end;
+ }
+ }
+
for (node = json->pstChild; node; node = node->pstNext)
{
ventoy_parse_json(control);
ret = 1;
}
+end:
vtoy_json_destroy(json);
free(buffer);