- // load drivers from the "drivers" subdirectory of rEFInd's home directory
- Directory = StrDuplicate(SelfDirPath);
- CleanUpPathNameSlashes(Directory);
- MergeStrings(&Directory, L"drivers", L'\\');
- NumFound += ScanDriverDir(Directory);
+ // load drivers from the subdirectories of rEFInd's home directory specified
+ // in the DRIVER_DIRS constant.
+ while ((Directory = FindCommaDelimited(DRIVER_DIRS, i++)) != NULL) {
+ SelfDirectory = StrDuplicate(SelfDirPath);
+ CleanUpPathNameSlashes(SelfDirectory);
+ MergeStrings(&SelfDirectory, Directory, L'\\');
+ NumFound += ScanDriverDir(SelfDirectory);
+ FreePool(Directory);
+ FreePool(SelfDirectory);
+ }