From: longpanda Date: Mon, 31 May 2021 12:46:45 +0000 (+0800) Subject: priority key>parent in menu class plugin X-Git-Tag: v1.0.46~7 X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/commitdiff_plain/a8edb99d28ab80432c6a16060b70fbc8c40f537c?ds=sidebyside priority key>parent in menu class plugin --- diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c index fc56936..8b3ecd7 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c @@ -2488,16 +2488,25 @@ const char * ventoy_plugin_get_menu_class(int type, const char *name, const char continue; } - if (node->parent) + if (node->parent == 0) { - if ((node->patlen < pathlen) && ventoy_plugin_is_parent(node->pattern, node->patlen, path)) + if ((node->patlen < namelen) && grub_strstr(name, node->pattern)) { return node->class; } } - else + } + + for (node = g_menu_class_head; node; node = node->next) + { + if (node->type != type) { - if ((node->patlen < namelen) && grub_strstr(name, node->pattern)) + continue; + } + + if (node->parent) + { + if ((node->patlen < pathlen) && ventoy_plugin_is_parent(node->pattern, node->patlen, path)) { return node->class; }