]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Fix the menu missing issue when there exist an invalid vlnk file. (#2228)
authorlongpanda <admin@ventoy.net>
Tue, 7 Mar 2023 10:05:33 +0000 (18:05 +0800)
committerlongpanda <admin@ventoy.net>
Tue, 7 Mar 2023 10:05:33 +0000 (18:05 +0800)
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c

index 51e9557eca71488d3ba747a5b7d11d241cb0759b..6b5a10e379660ba5c4283ef2cf03c77bb503ac17 100644 (file)
@@ -392,6 +392,11 @@ static int ventoy_browser_iterate_dir(const char *filename, const struct grub_di
             return 0;
         }
 
             return 0;
         }
 
+        if (grub_file_is_vlnk_suffix(filename, len))
+        {
+            return 0;
+        }
+
         node = grub_zalloc(sizeof(browser_node));
         if (!node)
         {
         node = grub_zalloc(sizeof(browser_node));
         if (!node)
         {
index 234a509bb27b5d9eac57b1194522b744ae751fdb..ba3ed0979e7907a5a6a42c791f5b81bd7c050f0a 100644 (file)
@@ -1767,6 +1767,10 @@ static int ventoy_check_vlnk_data(ventoy_vlnk *vlnk, int print, char *dst, int s
                         cur->fs->fs_close(&file);
                         grub_snprintf(dst, size - 1, "(%s)%s", cur->device, vlnk->filepath);
                     }
                         cur->fs->fs_close(&file);
                         grub_snprintf(dst, size - 1, "(%s)%s", cur->device, vlnk->filepath);
                     }
+                    else
+                    {
+                        grub_errno = 0;
+                    }
                 }
             }
         }
                 }
             }
         }