summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaben Carsey <jaben.carsey@intel.com>2013-11-15 20:21:34 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2013-11-15 20:21:34 +0000
commitd233c1229161480fb7ba1407962172436fdc4f2c (patch)
tree6f82541b208f275464f70fc516581f48c45dca20
parent12f1a36cf4badd843ff47d1f7efd713d847f782b (diff)
downloadedk2-platforms-d233c1229161480fb7ba1407962172436fdc4f2c.tar.xz
ShellPkg: Fix help MAN file searching
Make sure that “help App” and “help App.EFI” work the same by removing “.efi” (case insensitive) from the end of the string before searching for MAN file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14853 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--ShellPkg/Application/Shell/ShellManParser.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/ShellPkg/Application/Shell/ShellManParser.c b/ShellPkg/Application/Shell/ShellManParser.c
index 470f51a8ea..8196a6ac9d 100644
--- a/ShellPkg/Application/Shell/ShellManParser.c
+++ b/ShellPkg/Application/Shell/ShellManParser.c
@@ -1,7 +1,7 @@
/** @file
Provides interface to shell MAN file parser.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -491,6 +491,20 @@ ManFileFindTitleSection(
}
StrCpy(TitleString, L".TH ");
StrCat(TitleString, Command);
+
+ //
+ // If the "name" ends with .efi we can safely chop that off since "help foo.efi" and "help foo"
+ // should produce the same results.
+ //
+ if ((StrLen(Command)> 4)
+ && (TitleString[StrLen(TitleString)-1] == L'i' || TitleString[StrLen(TitleString)-1] == L'I')
+ && (TitleString[StrLen(TitleString)-2] == L'f' || TitleString[StrLen(TitleString)-2] == L'F')
+ && (TitleString[StrLen(TitleString)-3] == L'e' || TitleString[StrLen(TitleString)-2] == L'E')
+ && (TitleString[StrLen(TitleString)-4] == L'.')
+ ) {
+ TitleString[StrLen(TitleString)-4] = CHAR_NULL;
+ }
+
TitleLen = StrLen(TitleString);
for (;!ShellFileHandleEof(Handle);Size = 1024) {
Status = ShellFileHandleReadLine(Handle, ReadLine, &Size, TRUE, Ascii);