X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellLevel1CommandsLib%2FUefiShellLevel1CommandsLib.c;h=80d0dfe652201af9b777d15d923ba9182fd187d0;hp=72c5d07d520c469f3693ad7973aee18c044d8843;hb=c011b6c9e2baf57fc0557117e9875ceb3dca55a3;hpb=82571fb5d1c9093fd2387fc4a35a9f6fe5d541f4
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
index 72c5d07d52..80d0dfe652 100644
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
+++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
@@ -1,6 +1,7 @@
/** @file
Main file for NULL named library for level 1 shell command functions.
+ (C) Copyright 2013 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -16,11 +17,6 @@
STATIC CONST CHAR16 mFileName[] = L"ShellCommands";
EFI_HANDLE gShellLevel1HiiHandle = NULL;
-CONST EFI_GUID gShellLevel1HiiGuid = \
- { \
- 0xdec5daa4, 0x6781, 0x4820, { 0x9c, 0x63, 0xa7, 0xb0, 0xe4, 0xf1, 0xdb, 0x31 }
- };
-
/**
Return the help text filename. Only used if no HII information found.
@@ -112,17 +108,17 @@ ShellLevel1CommandsLibDestructor (
If label is used it will be used instead of the count.
- @param[in] Function The function to use to enumerate through the
- list. Normally GetNextNode or GetPreviousNode.
- @param[in] DecrementerTag The tag to decrement the count at.
- @param[in] IncrementerTag The tag to increment the count at.
- @param[in] Label A label to look for.
- @param[in,out] ScriptFile The pointer to the current script file structure.
- @param[in] MovePast TRUE makes function return 1 past the found
- location.
- @param[in] FindOnly TRUE to not change the ScriptFile.
- @param[in] CommandNode The pointer to the Node to test.
- @param[in,out] TargetCount The pointer to the current count.
+ @param[in] Function The function to use to enumerate through the
+ list. Normally GetNextNode or GetPreviousNode.
+ @param[in] DecrementerTag The tag to decrement the count at.
+ @param[in] IncrementerTag The tag to increment the count at.
+ @param[in] Label A label to look for.
+ @param[in, out] ScriptFile The pointer to the current script file structure.
+ @param[in] MovePast TRUE makes function return 1 past the found
+ location.
+ @param[in] FindOnly TRUE to not change the ScriptFile.
+ @param[in] CommandNode The pointer to the Node to test.
+ @param[in, out] TargetCount The pointer to the current count.
**/
BOOLEAN
EFIAPI
@@ -150,8 +146,16 @@ TestNodeForMove (
//
CommandName = NULL;
CommandName = StrnCatGrow(&CommandName, NULL, CommandNode->Cl, 0);
+ if (CommandName == NULL) {
+ return (FALSE);
+ }
+
CommandNameWalker = CommandName;
- while(CommandNameWalker[0] == L' ') {
+
+ //
+ // Skip leading spaces and tabs.
+ //
+ while ((CommandNameWalker[0] == L' ') || (CommandNameWalker[0] == L'\t')) {
CommandNameWalker++;
}
TempLocation = StrStr(CommandNameWalker, L" ");
@@ -229,17 +233,17 @@ TestNodeForMove (
If label is used it will be used instead of the count.
- @param[in] Function The function to use to enumerate through the
- list. Normally GetNextNode or GetPreviousNode.
- @param[in] DecrementerTag The tag to decrement the count at.
- @param[in] IncrementerTag The tag to increment the count at.
- @param[in] Label A label to look for.
- @param[in,out] ScriptFile The pointer to the current script file structure.
- @param[in] MovePast TRUE makes function return 1 past the found
- location.
- @param[in] FindOnly TRUE to not change the ScriptFile.
- @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in
- searching.
+ @param[in] Function The function to use to enumerate through the
+ list. Normally GetNextNode or GetPreviousNode.
+ @param[in] DecrementerTag The tag to decrement the count at.
+ @param[in] IncrementerTag The tag to increment the count at.
+ @param[in] Label A label to look for.
+ @param[in, out] ScriptFile The pointer to the current script file structure.
+ @param[in] MovePast TRUE makes function return 1 past the found
+ location.
+ @param[in] FindOnly TRUE to not change the ScriptFile.
+ @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in
+ searching.
**/
BOOLEAN
EFIAPI