summaryrefslogtreecommitdiff
path: root/ShellPkg/Application
diff options
context:
space:
mode:
authorQiu Shumin <shumin.qiu@intel.com>2015-12-25 03:11:33 +0000
committerhwu1225 <hwu1225@Edk2>2015-12-25 03:11:33 +0000
commit09060cfcf1602a6c69ae1000486d857fe24824e6 (patch)
tree0e086e7d9fb0da64db81e874e34940a3a79aed68 /ShellPkg/Application
parent17bcd74b0375a4b8a76a43bd7033a59f6ee84e40 (diff)
downloadedk2-platforms-09060cfcf1602a6c69ae1000486d857fe24824e6.tar.xz
ShellPkg: Refine the code format.
1. Add function header comment. 2. Non-Boolean comparisons should explicitly use a compare operator. (Sync patch r19424 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19544 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Application')
-rw-r--r--ShellPkg/Application/Shell/ShellManParser.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/ShellPkg/Application/Shell/ShellManParser.c b/ShellPkg/Application/Shell/ShellManParser.c
index 80028a6216..222cdafd6e 100644
--- a/ShellPkg/Application/Shell/ShellManParser.c
+++ b/ShellPkg/Application/Shell/ShellManParser.c
@@ -15,7 +15,26 @@
#include "Shell.h"
-CHAR16 EFIAPI InternalShellCharToUpper (IN CHAR16 Char);
+/**
+ Convert a Unicode character to upper case only if
+ it maps to a valid small-case ASCII character.
+
+ This internal function only deal with Unicode character
+ which maps to a valid small-case ASCII character, i.e.
+ L'a' to L'z'. For other Unicode character, the input character
+ is returned directly.
+
+ @param Char The character to convert.
+
+ @retval LowerCharacter If the Char is with range L'a' to L'z'.
+ @retval Unchanged Otherwise.
+
+**/
+CHAR16
+EFIAPI
+InternalShellCharToUpper (
+ IN CHAR16 Char
+ );
/**
Verifies that the filename has .MAN on the end.
@@ -632,7 +651,7 @@ ManFileFindTitleSection(
// Do not pass any leading path information that may be present to IsTitleHeader().
//
Start = StrLen(Command);
- while (Start
+ while ((Start != 0)
&& (*(Command + Start - 1) != L'\\')
&& (*(Command + Start - 1) != L'/')
&& (*(Command + Start - 1) != L':')) {