- if (!(GlobalConfig.DisableFlags & DISABLE_FLAG_SHELL)) {
- SPrint(FileName, 255, L"%s\\apps\\shell.efi", SelfDirPath);
- if (FileExists(SelfRootDir, FileName)) {
- AddToolEntry(FileName, L"EFI Shell", BuiltinIcon(BUILTIN_ICON_TOOL_SHELL), 'E', FALSE);
- } else {
- StrCpy(FileName, L"\\efi\\tools\\shell.efi");
- if (FileExists(SelfRootDir, FileName)) {
- AddToolEntry(FileName, L"EFI Shell", BuiltinIcon(BUILTIN_ICON_TOOL_SHELL), 'E', FALSE);
- }
- }
- }
+ while (((FileName = FindCommaDelimited(SHELL_NAMES, i++)) != NULL) && (!(GlobalConfig.DisableFlags & DISABLE_FLAG_SHELL))) {
+ if (FileExists(SelfRootDir, FileName)) {
+ AddToolEntry(FileName, L"EFI Shell", BuiltinIcon(BUILTIN_ICON_TOOL_SHELL), 'E', FALSE);
+ }
+ FreePool(FileName);
+ FileName = NULL;
+ } // while