]> code.delx.au - refind/blobdiff - refind/config.c
New ability to specify volume labels in "dont_scan_dirs" token to
[refind] / refind / config.c
index 441d2a4468fe52083bd65b2aaf102691a36fb7ef..63d0f312857601b373667f3a9f41957d5c08a739 100644 (file)
@@ -341,6 +341,7 @@ VOID ReadConfig(CHAR16 *FileName)
     REFIT_FILE      File;
     CHAR16          **TokenList;
     CHAR16          *FlagName;
+    CHAR16          *SelfPath = NULL;
     UINTN           TokenCount, i;
 
     // Set a few defaults only if we're loading the default file.
@@ -350,11 +351,16 @@ VOID ReadConfig(CHAR16 *FileName)
 //        MyFreePool(GlobalConfig.DontScanVolumes);
 //        GlobalConfig.DontScanVolumes = StrDuplicate(L" ");
        MyFreePool(GlobalConfig.DontScanDirs);
-       GlobalConfig.DontScanDirs = StrDuplicate(SelfDirPath);
+       if (SelfVolume->VolName) {
+          SelfPath = StrDuplicate(SelfVolume->VolName);
+       } else {
+          SelfPath = AllocateZeroPool(256 * sizeof(CHAR16));
+          SPrint(SelfPath, 255, L"fs%d", SelfVolume->VolNumber);
+       } // if/else
+       MergeStrings(&SelfPath, SelfDirPath, L':');
+       GlobalConfig.DontScanDirs = SelfPath;
        MyFreePool(GlobalConfig.DontScanFiles);
        GlobalConfig.DontScanFiles = StrDuplicate(DONT_SCAN_FILES);
-//        egGetScreenSize(&GlobalConfig.RequestedScreenWidth, &GlobalConfig.RequestedScreenHeight);
-//       GlobalConfig.RequestedTextMode = ST->ConOut->Mode->Mode;
     }
 
     if (!FileExists(SelfDir, FileName)) {