discover/grub: Fix handling of empty strings