StrCpy(TitleString, L".TH ");\r
StrCat(TitleString, Command);\r
\r
- //\r
- // If the "name" ends with .efi we can safely chop that off since "help foo.efi" and "help foo" \r
- // should produce the same results.\r
- //\r
- if ((StrLen(Command)> 4)\r
- && (TitleString[StrLen(TitleString)-1] == L'i' || TitleString[StrLen(TitleString)-1] == L'I')\r
- && (TitleString[StrLen(TitleString)-2] == L'f' || TitleString[StrLen(TitleString)-2] == L'F')\r
- && (TitleString[StrLen(TitleString)-3] == L'e' || TitleString[StrLen(TitleString)-2] == L'E')\r
- && (TitleString[StrLen(TitleString)-4] == L'.')\r
- ) {\r
- TitleString[StrLen(TitleString)-4] = CHAR_NULL;\r
- }\r
-\r
TitleLen = StrLen(TitleString);\r
for (;!ShellFileHandleEof(Handle);Size = 1024) {\r
Status = ShellFileHandleReadLine(Handle, ReadLine, &Size, TRUE, Ascii);\r
)\r
{\r
CONST CHAR16 *ManFileName;\r
+ CHAR16 *FixCommand;\r
+ EFI_STATUS Status;\r
\r
ASSERT(HelpText != NULL);\r
+ FixCommand = NULL;\r
\r
ManFileName = ShellCommandGetManFileNameHandler(Command);\r
\r
if (ManFileName != NULL) {\r
return (ProcessManFile(ManFileName, Command, Sections, NULL, HelpText));\r
} else {\r
- return (ProcessManFile(Command, Command, Sections, NULL, HelpText));\r
+ if ((StrLen(Command)> 4)\r
+ && (Command[StrLen(Command)-1] == L'i' || Command[StrLen(Command)-1] == L'I')\r
+ && (Command[StrLen(Command)-2] == L'f' || Command[StrLen(Command)-2] == L'F')\r
+ && (Command[StrLen(Command)-3] == L'e' || Command[StrLen(Command)-3] == L'E')\r
+ && (Command[StrLen(Command)-4] == L'.')\r
+ ) {\r
+ FixCommand = AllocateZeroPool(StrSize(Command) - 4 * sizeof (CHAR16));\r
+ ASSERT(FixCommand != NULL);\r
+\r
+ StrnCpy(FixCommand, Command, StrLen(Command)-4);\r
+ Status = ProcessManFile(FixCommand, FixCommand, Sections, NULL, HelpText);\r
+ FreePool(FixCommand);\r
+ return Status;\r
+ } else {\r
+ return (ProcessManFile(Command, Command, Sections, NULL, HelpText));\r
+ }\r
}\r
}\r
\r