]> code.delx.au - refind/blobdiff - refind/lib.c
Fine-tuning of loader detection code.
[refind] / refind / lib.c
index dadce367e57666cac4eab59a72ff415b9affdc10..66dbe00e21fd967858cd5764a5d31b287040a52b 100644 (file)
@@ -48,6 +48,7 @@
 #include "screen.h"
 #include "../include/refit_call_wrapper.h"
 #include "../include/RemovableMedia.h"
+//#include "../include/UsbMass.h"
 
 #ifdef __MAKEWITH_GNUEFI
 #define EfiReallocatePool ReallocatePool
@@ -92,9 +93,6 @@ UINTN            VolumesCount = 0;
 // and identify its boot loader, and hence probable BIOS-mode OS installation
 #define SAMPLE_SIZE 69632 /* 68 KiB -- ReiserFS superblock begins at 64 KiB */
 
-// Default names for volume badges (mini-icon to define disk type) and icons
-#define VOLUME_BADGE_NAMES L".VolumeBadge.icns,.VolumeBadge.png"
-#define VOLUME_ICON_NAMES L".VolumeIcon.icns,.VolumeIcon.png"
 
 // functions
 
@@ -852,9 +850,9 @@ VOID ScanVolume(REFIT_VOLUME *Volume)
 
     // get custom volume icon if present
     if (!Volume->VolBadgeImage)
-       Volume->VolBadgeImage = LoadIcns(Volume->RootDir, VOLUME_BADGE_NAMES, 32);
+       Volume->VolBadgeImage = egLoadIconAnyType(Volume->RootDir, L"", L".VolumeBadge", 32);
     if (!Volume->VolIconImage)
-       Volume->VolIconImage = LoadIcns(Volume->RootDir, VOLUME_ICON_NAMES, 128);
+       Volume->VolIconImage = egLoadIconAnyType(Volume->RootDir, L"", L".VolumeIcon", 128);
 } // ScanVolume()
 
 static VOID ScanExtendedPartition(REFIT_VOLUME *WholeDiskVolume, MBR_PARTITION_INFO *MbrEntry)
@@ -1275,11 +1273,12 @@ BOOLEAN DirIterNext(IN OUT REFIT_DIR_ITER *DirIter, IN UINTN FilterMode, IN CHAR
             while (KeepGoing && (OnePattern = FindCommaDelimited(FilePattern, i++)) != NULL) {
                if (MetaiMatch(DirIter->LastFileInfo->FileName, OnePattern))
                    KeepGoing = FALSE;
+//               Print(L"%s did%s match %s\n", DirIter->LastFileInfo->FileName, KeepGoing ? L" not" : L"", OnePattern);
             } // while
             // else continue loop
         } else
             break;
-   } while (KeepGoing);
+   } while (KeepGoing && FilePattern);
 
     *DirEntry = DirIter->LastFileInfo;
     return TRUE;