]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/Shell.c
ShellPkg: replace unrecognized Environment Variables with empty quotes so commands...
[mirror_edk2.git] / ShellPkg / Application / Shell / Shell.c
index 951d31e82bcd84a3b0ec181825c69430fdbdd85c..4abeafcd44474f08a9c45e05ff263bf4ada4d3f0 100644 (file)
@@ -1378,14 +1378,14 @@ StripUnreplacedEnvironmentVariables(
     }\r
     ASSERT(FirstPercent < FirstQuote);\r
     if (SecondPercent < FirstQuote) {\r
-      //\r
-      // We need to remove from FirstPercent to SecondPercent\r
-      //\r
-      CopyMem(FirstPercent, SecondPercent + 1, StrSize(SecondPercent + 1));\r
+      FirstPercent[0] = L'\"';\r
+      SecondPercent[0] = L'\"';\r
 \r
       //\r
-      // dont need to update the locator.  both % characters are gone.\r
+      // We need to remove from FirstPercent to SecondPercent\r
       //\r
+      CopyMem(FirstPercent + 1, SecondPercent, StrSize(SecondPercent));\r
+      CurrentLocator = FirstPercent + 2;\r
       continue;\r
     }\r
     ASSERT(FirstQuote < SecondPercent);\r