- if (!FileExists(SelfDir, CONFIG_FILE_NAME)) {
- Print(L"Configuration file missing!\n");
+ // Set a few defaults only if we're loading the default file.
+ if (StriCmp(FileName, CONFIG_FILE_NAME) == 0) {
+ MyFreePool(GlobalConfig.AlsoScan);
+ GlobalConfig.AlsoScan = StrDuplicate(ALSO_SCAN_DIRS);
+ MyFreePool(GlobalConfig.DontScanDirs);
+ if (SelfVolume) {
+ if (SelfVolume->VolName) {
+ SelfPath = SelfVolume->VolName ? StrDuplicate(SelfVolume->VolName) : NULL;
+ } else {
+ SelfPath = AllocateZeroPool(256 * sizeof(CHAR16));
+ if (SelfPath != NULL)
+ 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);
+ } // if
+
+ if (!FileExists(SelfDir, FileName)) {
+ Print(L"Configuration file '%s' missing!\n", FileName);