Revision: 14853
          http://sourceforge.net/p/edk2/code/14853
Author:   jcarsey
Date:     2013-11-15 20:21:34 +0000 (Fri, 15 Nov 2013)
Log Message:
-----------
ShellPkg: Fix help MAN file searching
Make sure that ?\226?\128?\156help App?\226?\128?\157 and ?\226?\128?\156help 
App.EFI?\226?\128?\157 work the same by removing 
?\226?\128?\156.efi?\226?\128?\157 (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 <[email protected]>
Reviewed-by: Erik Bjorge <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ShellPkg/Application/Shell/ShellManParser.c

Modified: trunk/edk2/ShellPkg/Application/Shell/ShellManParser.c
===================================================================
--- trunk/edk2/ShellPkg/Application/Shell/ShellManParser.c      2013-11-15 
18:55:36 UTC (rev 14852)
+++ trunk/edk2/ShellPkg/Application/Shell/ShellManParser.c      2013-11-15 
20:21:34 UTC (rev 14853)
@@ -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 @@
   }
   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);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to