X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ShellPkg%2FApplication%2FShell%2FShellEnvVar.c;h=663276454273d7cb239e898134fa68ddbd85264b;hb=ba0014b9f8ae1a593f03e744f26008214c2b06a8;hp=4c49c1ca980e1df17f9d238974f3ccc46fa040a5;hpb=24bfed691d9b581830933623204b56a704d1abd2;p=mirror_edk2.git diff --git a/ShellPkg/Application/Shell/ShellEnvVar.c b/ShellPkg/Application/Shell/ShellEnvVar.c index 4c49c1ca98..6632764542 100644 --- a/ShellPkg/Application/Shell/ShellEnvVar.c +++ b/ShellPkg/Application/Shell/ShellEnvVar.c @@ -1,7 +1,7 @@ /** @file function declarations for shell environment functions. - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, 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 which accompanies this distribution. The full text of the license may be found at @@ -143,9 +143,9 @@ GetEnvironmentVariableList( if (ListHead == NULL) { return (EFI_INVALID_PARAMETER); } - + Status = EFI_SUCCESS; - + ValBufferSize = INIT_DATA_BUFFER_SIZE; NameBufferSize = INIT_NAME_BUFFER_SIZE; VariableName = AllocateZeroPool(NameBufferSize); @@ -171,7 +171,7 @@ GetEnvironmentVariableList( NameSize = NameBufferSize; Status = gRT->GetNextVariableName(&NameSize, VariableName, &Guid); } - + if (!EFI_ERROR(Status) && CompareGuid(&Guid, &gShellVariableGuid)){ VarList = AllocateZeroPool(sizeof(ENV_VAR_LIST)); if (VarList == NULL) { @@ -200,7 +200,7 @@ GetEnvironmentVariableList( Status = EFI_OUT_OF_RESOURCES; break; } - + ValSize = ValBufferSize; Status = SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(VariableName, &VarList->Atts, &ValSize, VarList->Val); } @@ -348,8 +348,8 @@ SetEnvironmentVariables( // // Copy the string into the Key, leaving the last character allocated as NULL to terminate // - StrnCpyS( Node->Key, - StrStr(CurrentString, L"=") - CurrentString + 1, + StrnCpyS( Node->Key, + StrStr(CurrentString, L"=") - CurrentString + 1, CurrentString, StrStr(CurrentString, L"=") - CurrentString ); @@ -413,7 +413,7 @@ ShellFindEnvVarInList ( ) { ENV_VAR_LIST *Node; - + if (Key == NULL || Value == NULL || ValueSize == NULL) { return SHELL_INVALID_PARAMETER; } @@ -459,7 +459,7 @@ ShellAddEnvVarToList ( ENV_VAR_LIST *Node; CHAR16 *LocalKey; CHAR16 *LocalValue; - + if (Key == NULL || Value == NULL || ValueSize == 0) { return EFI_INVALID_PARAMETER; } @@ -511,7 +511,7 @@ ShellAddEnvVarToList ( Remove a specified environment variable in gShellEnvVarList. @param Key The name of the environment variable. - + @retval EFI_SUCCESS The command executed successfully. @retval EFI_NOT_FOUND The environment variable is not found in gShellEnvVarList. @@ -546,7 +546,7 @@ ShellRemvoeEnvVarFromList ( /** Initialize the gShellEnvVarList and cache all Shell-Guid-based environment variables. - + **/ EFI_STATUS ShellInitEnvVarList (