/** @file\r
This is THE shell (application)\r
\r
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2013-2014, Hewlett-Packard Development Company, L.P.\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
break;\r
}\r
\r
- if (FirstQuote < FirstPercent) {\r
- SecondQuote = FirstQuote!= NULL?FindNextInstance(FirstQuote+1, L"\"", TRUE):NULL;\r
+ if (FirstQuote!= NULL && FirstQuote < FirstPercent) {\r
+ SecondQuote = FindNextInstance(FirstQuote+1, L"\"", TRUE);\r
//\r
// Quote is first found\r
//\r
}\r
continue;\r
}\r
- ASSERT(FirstPercent < FirstQuote);\r
- if (SecondPercent < FirstQuote) {\r
+ \r
+ if (FirstQuote == NULL || SecondPercent < FirstQuote) {\r
if (IsValidEnvironmentVariableName(FirstPercent, SecondPercent)) {\r
//\r
// We need to remove from FirstPercent to SecondPercent\r
}\r
continue;\r
}\r
- ASSERT(FirstQuote < SecondPercent);\r
CurrentLocator = FirstQuote;\r
}\r
return (EFI_SUCCESS);\r
ShellCopySearchAndReplace(NewCommandLine1, NewCommandLine2, NewSize, AliasListNode->Alias, AliasListNode->CommandString, TRUE, FALSE);\r
StrnCpy(NewCommandLine1, NewCommandLine2, NewSize/sizeof(CHAR16)-1);\r
}\r
-\r
- //\r
- // Remove non-existant environment variables in scripts only\r
- //\r
- StripUnreplacedEnvironmentVariables(NewCommandLine1);\r
}\r
\r
+ //\r
+ // Remove non-existant environment variables\r
+ //\r
+ StripUnreplacedEnvironmentVariables(NewCommandLine1);\r
+\r
//\r
// Now cleanup any straggler intentionally ignored "%" characters\r
//\r