]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/ShellParametersProtocol.c
ShellPkg: Standardized HP Copyright Message String
[mirror_edk2.git] / ShellPkg / Application / Shell / ShellParametersProtocol.c
index a01a5c6a71581bfecf88f834b13d16b63caf9d8a..00b413e90b4d136f64125c3bce9cb1489a0256d3 100644 (file)
@@ -2,7 +2,9 @@
   Member functions of EFI_SHELL_PARAMETERS_PROTOCOL and functions for creation,\r
   manipulation, and initialization of EFI_SHELL_PARAMETERS_PROTOCOL.\r
 \r
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (C) 2014, Red Hat, Inc.\r
+  (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>\r
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
 #include "Shell.h"\r
 \r
 /**\r
-  return the next parameter from a command line string;\r
+  Return the next parameter's end from a command line string.\r
+\r
+  @param[in] String        the string to parse\r
+**/\r
+CONST CHAR16*\r
+EFIAPI\r
+FindEndOfParameter(\r
+  IN CONST CHAR16 *String\r
+  )\r
+{\r
+  CONST CHAR16 *First;\r
+  CONST CHAR16 *CloseQuote;\r
+\r
+  First = FindFirstCharacter(String, L" \"", L'^');\r
+\r
+  //\r
+  // nothing, all one parameter remaining\r
+  //\r
+  if (*First == CHAR_NULL) {\r
+    return (First);\r
+  }\r
+\r
+  //\r
+  // If space before a quote (or neither found, i.e. both CHAR_NULL),\r
+  // then that's the end.\r
+  //\r
+  if (*First == L' ') {\r
+    return (First);\r
+  }\r
+\r
+  CloseQuote = FindFirstCharacter (First+1, L"\"", L'^');\r
+\r
+  //\r
+  // We did not find a terminator...\r
+  //\r
+  if (*CloseQuote == CHAR_NULL) {\r
+    return (NULL);\r
+  }\r
+\r
+  return (FindEndOfParameter (CloseQuote+1));\r
+}\r
+\r
+/**\r
+  Return the next parameter from a command line string.\r
 \r
   This function moves the next parameter from Walker into TempParameter and moves\r
   Walker up past that parameter for recursive calling.  When the final parameter\r
   Temp Parameter must be large enough to hold the parameter before calling this\r
   function.\r
 \r
+  This will also remove all remaining ^ characters after processing.\r
+\r
   @param[in, out] Walker        pointer to string of command line.  Adjusted to\r
                                 reminaing command line on return\r
   @param[in, out] TempParameter pointer to string of command line item extracted.\r
+  @param[in]      Length        buffer size of TempParameter.\r
 \r
+  @return   EFI_INALID_PARAMETER  A required parameter was NULL or pointed to a NULL or empty string.\r
+  @return   EFI_NOT_FOUND         A closing " could not be found on the specified string\r
 **/\r
-VOID\r
+EFI_STATUS\r
 EFIAPI\r
 GetNextParameter(\r
-  CHAR16 **Walker,\r
-  CHAR16 **TempParameter\r
+  IN OUT CHAR16   **Walker,\r
+  IN OUT CHAR16   **TempParameter,\r
+  IN CONST UINTN  Length\r
   )\r
 {\r
-  CHAR16 *NextDelim;\r
-  CHAR16 *TempLoc;\r
+  CONST CHAR16 *NextDelim;\r
+\r
+  if (Walker           == NULL\r
+    ||*Walker          == NULL\r
+    ||TempParameter    == NULL\r
+    ||*TempParameter   == NULL\r
+    ){\r
+    return (EFI_INVALID_PARAMETER);\r
+  }\r
 \r
-  ASSERT(Walker           != NULL);\r
-  ASSERT(*Walker          != NULL);\r
-  ASSERT(TempParameter    != NULL);\r
-  ASSERT(*TempParameter   != NULL);\r
 \r
   //\r
   // make sure we dont have any leading spaces\r
@@ -56,77 +110,60 @@ GetNextParameter(
   // make sure we still have some params now...\r
   //\r
   if (StrLen(*Walker) == 0) {\r
-    ASSERT((*Walker)[0] == CHAR_NULL);\r
-    *Walker = NULL;\r
-    return;\r
+DEBUG_CODE_BEGIN();\r
+    *Walker        = NULL;\r
+DEBUG_CODE_END();\r
+    return (EFI_INVALID_PARAMETER);\r
+  }\r
+\r
+  NextDelim = FindEndOfParameter(*Walker);\r
+\r
+  if (NextDelim == NULL){\r
+DEBUG_CODE_BEGIN();\r
+    *Walker        = NULL;\r
+DEBUG_CODE_END();\r
+    return (EFI_NOT_FOUND);\r
   }\r
 \r
+  StrnCpy(*TempParameter, (*Walker), NextDelim - *Walker);\r
+\r
   //\r
-  // we have a quoted parameter\r
-  // could be the last parameter, but SHOULD have a trailing quote\r
+  // Add a CHAR_NULL if we didnt get one via the copy\r
   //\r
-  if ((*Walker)[0] == L'\"') {\r
-    NextDelim = NULL;\r
-    for (TempLoc = *Walker + 1 ; TempLoc != NULL && *TempLoc != CHAR_NULL ; TempLoc++) {\r
-      if (*TempLoc == L'^' && *(TempLoc+1) == L'\"') {\r
-        TempLoc++;\r
-      } else if (*TempLoc == L'\"') {\r
-        NextDelim = TempLoc;\r
-        break;\r
-      }\r
-    }\r
+  if (*NextDelim != CHAR_NULL) {\r
+    (*TempParameter)[NextDelim - *Walker] = CHAR_NULL;\r
+  }\r
+\r
+  //\r
+  // Update Walker for the next iteration through the function\r
+  //\r
+  *Walker = (CHAR16*)NextDelim;\r
+\r
+  //\r
+  // Remove any non-escaped quotes in the string\r
+  // Remove any remaining escape characters in the string\r
+  //\r
+  for (NextDelim = FindFirstCharacter(*TempParameter, L"\"^", CHAR_NULL) \r
+    ; *NextDelim != CHAR_NULL \r
+    ; NextDelim = FindFirstCharacter(NextDelim, L"\"^", CHAR_NULL)\r
+    ) {\r
+    if (*NextDelim == L'^') {\r
 \r
-    if (NextDelim - ((*Walker)+1) == 0) {\r
-      //\r
-      // found ""\r
-      //\r
-      StrCpy(*TempParameter, L"");\r
-      *Walker = NextDelim + 1;\r
-    } else if (NextDelim != NULL) {\r
-      StrnCpy(*TempParameter, (*Walker)+1, NextDelim - ((*Walker)+1));\r
-      *Walker = NextDelim + 1;\r
-    } else {\r
       //\r
-      // last one... someone forgot the training quote!\r
+      // eliminate the escape ^\r
       //\r
-      StrCpy(*TempParameter, *Walker);\r
-      *Walker = NULL;\r
-    }\r
-    for (TempLoc = *TempParameter ; TempLoc != NULL && *TempLoc != CHAR_NULL ; TempLoc++) {\r
-      if (*TempLoc == L'^' && *(TempLoc+1) == L'\"') {\r
-        CopyMem(TempLoc, TempLoc+1, StrSize(TempLoc) - sizeof(TempLoc[0]));\r
-      }\r
-    }\r
-  } else {\r
-    //\r
-    // we have a regular parameter (no quote) OR\r
-    // we have the final parameter (no trailing space)\r
-    //\r
-    NextDelim = StrStr((*Walker), L" ");\r
-    if (NextDelim != NULL) {\r
-      StrnCpy(*TempParameter, *Walker, NextDelim - (*Walker));\r
-      (*TempParameter)[NextDelim - (*Walker)] = CHAR_NULL;\r
-      *Walker = NextDelim+1;\r
-    } else {\r
+      CopyMem ((CHAR16*)NextDelim, NextDelim + 1, StrSize (NextDelim + 1));\r
+      NextDelim++;\r
+    } else if (*NextDelim == L'\"') {\r
+\r
       //\r
-      // last one.\r
+      // eliminate the unescaped quote\r
       //\r
-      StrCpy(*TempParameter, *Walker);\r
-      *Walker = NULL;\r
-    }\r
-    for (NextDelim = *TempParameter ; NextDelim != NULL && *NextDelim != CHAR_NULL ; NextDelim++) {\r
-      if (*NextDelim == L'^' && *(NextDelim+1) == L'^') {\r
-        CopyMem(NextDelim, NextDelim+1, StrSize(NextDelim) - sizeof(NextDelim[0]));\r
-      }\r
-    }\r
-    while ((*TempParameter)[StrLen(*TempParameter)-1] == L' ') {\r
-      (*TempParameter)[StrLen(*TempParameter)-1] = CHAR_NULL;\r
-    }\r
-    while ((*TempParameter)[0] == L' ') {\r
-      CopyMem(*TempParameter, (*TempParameter)+1, StrSize(*TempParameter) - sizeof((*TempParameter)[0]));\r
+      CopyMem ((CHAR16*)NextDelim, NextDelim + 1, StrSize (NextDelim + 1));\r
     }\r
   }\r
-  return;\r
+\r
+  return EFI_SUCCESS;\r
 }\r
 \r
 /**\r
@@ -136,6 +173,9 @@ GetNextParameter(
   parameters for inclusion in EFI_SHELL_PARAMETERS_PROTOCOL.  this supports space\r
   delimited and quote surrounded parameter definition.\r
 \r
+  All special character processing (alias, environment variable, redirection, \r
+  etc... must be complete before calling this API.\r
+\r
   @param[in] CommandLine         String of command line to parse\r
   @param[in, out] Argv           pointer to array of strings; one for each parameter\r
   @param[in, out] Argc           pointer to number of strings in Argv array\r
@@ -175,17 +215,13 @@ ParseCommandLineToArgs(
   for ( Count = 0\r
       , Walker = (CHAR16*)CommandLine\r
       ; Walker != NULL && *Walker != CHAR_NULL\r
-      ; GetNextParameter(&Walker, &TempParameter)\r
-      , Count++\r
-     );\r
-\r
-/*  Count = 0;\r
-  Walker = (CHAR16*)CommandLine;\r
-  while(Walker != NULL) {\r
-    GetNextParameter(&Walker, &TempParameter);\r
-    Count++;\r
+      ; Count++\r
+      ) {\r
+    if (EFI_ERROR(GetNextParameter(&Walker, &TempParameter, Size))) {\r
+      break;\r
+    }\r
   }\r
-*/\r
+\r
   //\r
   // lets allocate the pointer array\r
   //\r
@@ -199,10 +235,16 @@ ParseCommandLineToArgs(
   Walker = (CHAR16*)CommandLine;\r
   while(Walker != NULL && *Walker != CHAR_NULL) {\r
     SetMem16(TempParameter, Size, CHAR_NULL);\r
-    GetNextParameter(&Walker, &TempParameter);\r
-    NewParam = AllocateZeroPool(StrSize(TempParameter));\r
-    ASSERT(NewParam != NULL);\r
-    StrCpy(NewParam, TempParameter);\r
+    if (EFI_ERROR(GetNextParameter(&Walker, &TempParameter, Size))) {\r
+      SHELL_FREE_NON_NULL(TempParameter);\r
+      return (EFI_INVALID_PARAMETER);\r
+    }\r
+\r
+    NewParam = AllocateCopyPool(StrSize(TempParameter), TempParameter);\r
+    if (NewParam == NULL){\r
+      SHELL_FREE_NON_NULL(TempParameter);\r
+      return (EFI_OUT_OF_RESOURCES);\r
+    }\r
     ((CHAR16**)(*Argv))[(*Argc)] = NewParam;\r
     (*Argc)++;\r
   }\r
@@ -290,10 +332,10 @@ CreatePopulateInstallShellParametersProtocol (
   //\r
   // Build the full command line\r
   //\r
-  Status = SHELL_GET_ENVIRONMENT_VARIABLE(L"ShellOpt", &Size, &FullCommandLine);\r
+  Status = SHELL_GET_ENVIRONMENT_VARIABLE(L"ShellOpt", &Size, FullCommandLine);\r
   if (Status == EFI_BUFFER_TOO_SMALL) {\r
     FullCommandLine = AllocateZeroPool(Size + LoadedImage->LoadOptionsSize);\r
-    Status = SHELL_GET_ENVIRONMENT_VARIABLE(L"ShellOpt", &Size, &FullCommandLine);\r
+    Status = SHELL_GET_ENVIRONMENT_VARIABLE(L"ShellOpt", &Size, FullCommandLine);\r
   }\r
   if (Status == EFI_NOT_FOUND) {\r
     //\r
@@ -313,9 +355,7 @@ CreatePopulateInstallShellParametersProtocol (
     FullCommandLine = AllocateZeroPool(Size);\r
   }\r
   if (FullCommandLine != NULL) {\r
-    if (LoadedImage->LoadOptionsSize != 0){\r
-      StrCpy(FullCommandLine, LoadedImage->LoadOptions);\r
-    }\r
+    CopyMem (FullCommandLine, LoadedImage->LoadOptions, LoadedImage->LoadOptionsSize);\r
     //\r
     // Populate Argc and Argv\r
     //\r
@@ -539,6 +579,90 @@ FixFileName (
   return (Copy);\r
 }\r
 \r
+/**\r
+  Fix a string to only have the environment variable name, removing starting at the first space of whatever is quoted and removing the leading and trailing %.\r
+\r
+  @param[in]  FileName    The filename to start with.\r
+\r
+  @retval NULL  FileName was invalid.\r
+  @return       The modified FileName.\r
+**/\r
+CHAR16*\r
+EFIAPI\r
+FixVarName (\r
+  IN CHAR16 *FileName\r
+  )\r
+{\r
+  CHAR16  *Copy;\r
+  CHAR16  *TempLocation;\r
+\r
+  Copy = FileName;\r
+\r
+  if (FileName[0] == L'%') {\r
+    Copy = FileName+1;\r
+    if ((TempLocation = StrStr(Copy , L"%")) != NULL) {\r
+      TempLocation[0] = CHAR_NULL;\r
+    }    \r
+  }\r
+\r
+  return (FixFileName(Copy));\r
+}\r
+\r
+/**\r
+  Remove the unicode file tag from the begining of the file buffer since that will not be\r
+  used by StdIn.\r
+  \r
+  @param[in]  Handle    Pointer to the handle of the file to be processed.\r
+  \r
+  @retval EFI_SUCCESS   The unicode file tag has been moved successfully.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+RemoveFileTag(\r
+  IN SHELL_FILE_HANDLE *Handle\r
+  )\r
+{\r
+  UINTN             CharSize;\r
+  CHAR16            CharBuffer;\r
+\r
+  CharSize    = sizeof(CHAR16);\r
+  CharBuffer  = 0;\r
+  gEfiShellProtocol->ReadFile(*Handle, &CharSize, &CharBuffer);\r
+  if (CharBuffer != gUnicodeFileTag) {\r
+    gEfiShellProtocol->SetFilePosition(*Handle, 0);\r
+  }\r
+  return (EFI_SUCCESS);\r
+}\r
+\r
+/**\r
+  Write the unicode file tag to the specified file.\r
+\r
+  It is the caller's responsibility to ensure that\r
+  ShellInfoObject.NewEfiShellProtocol has been initialized before calling this\r
+  function.\r
+\r
+  @param[in] FileHandle  The file to write the unicode file tag to.\r
+\r
+  @return  Status code from ShellInfoObject.NewEfiShellProtocol->WriteFile.\r
+**/\r
+EFI_STATUS\r
+WriteFileTag (\r
+  IN SHELL_FILE_HANDLE FileHandle\r
+  )\r
+{\r
+  CHAR16     FileTag;\r
+  UINTN      Size;\r
+  EFI_STATUS Status;\r
+\r
+  FileTag = gUnicodeFileTag;\r
+  Size = sizeof FileTag;\r
+  Status = ShellInfoObject.NewEfiShellProtocol->WriteFile (FileHandle, &Size,\r
+                                                  &FileTag);\r
+  ASSERT (EFI_ERROR (Status) || Size == sizeof FileTag);\r
+  return Status;\r
+}\r
+\r
+\r
 /**\r
   Funcion will replace the current StdIn and StdOut in the ShellParameters protocol\r
   structure by parsing NewCommandLine.  The current values are returned to the\r
@@ -584,7 +708,6 @@ UpdateStdInStdOutStdErr(
   BOOLEAN           OutAppend;\r
   BOOLEAN           ErrAppend;\r
   UINTN             Size;\r
-  CHAR16            TagBuffer[2];\r
   SPLIT_LIST        *Split;\r
   CHAR16            *FirstLocation;\r
 \r
@@ -889,7 +1012,7 @@ UpdateStdInStdOutStdErr(
   //\r
   // re-populate the string to support any filenames that were in quotes.\r
   //\r
-  StrCpy(CommandLineCopy, NewCommandLine);\r
+  StrnCpy(CommandLineCopy, NewCommandLine, StrLen(NewCommandLine));\r
 \r
   if (FirstLocation != CommandLineCopy + StrLen(CommandLineCopy)\r
     && ((UINTN)(FirstLocation - CommandLineCopy) < StrLen(NewCommandLine))\r
@@ -915,17 +1038,17 @@ UpdateStdInStdOutStdErr(
       }\r
     }\r
     if (StdErrVarName  != NULL) {\r
-      if ((StdErrVarName     = FixFileName(StdErrVarName)) == NULL) {\r
+      if ((StdErrVarName     = FixVarName(StdErrVarName)) == NULL) {\r
         Status = EFI_INVALID_PARAMETER;\r
       }\r
     }\r
     if (StdOutVarName  != NULL) {\r
-      if ((StdOutVarName     = FixFileName(StdOutVarName)) == NULL) {\r
+      if ((StdOutVarName     = FixVarName(StdOutVarName)) == NULL) {\r
         Status = EFI_INVALID_PARAMETER;\r
       }\r
     }\r
     if (StdInVarName   != NULL) {\r
-      if ((StdInVarName      = FixFileName(StdInVarName)) == NULL) {\r
+      if ((StdInVarName      = FixVarName(StdInVarName)) == NULL) {\r
         Status = EFI_INVALID_PARAMETER;\r
       }\r
     }\r
@@ -996,13 +1119,7 @@ UpdateStdInStdOutStdErr(
         }\r
         Status = ShellOpenFileByName(StdErrFileName, &TempHandle, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ|EFI_FILE_MODE_CREATE,0);\r
         if (!ErrAppend && ErrUnicode && !EFI_ERROR(Status)) {\r
-          //\r
-          // Write out the gUnicodeFileTag\r
-          //\r
-          Size = sizeof(CHAR16);\r
-          TagBuffer[0] = gUnicodeFileTag;\r
-          TagBuffer[1] = CHAR_NULL;\r
-          ShellInfoObject.NewEfiShellProtocol->WriteFile(TempHandle, &Size, TagBuffer);\r
+          Status = WriteFileTag (TempHandle);\r
         }\r
         if (!ErrUnicode && !EFI_ERROR(Status)) {\r
           TempHandle = CreateFileInterfaceFile(TempHandle, FALSE);\r
@@ -1010,7 +1127,7 @@ UpdateStdInStdOutStdErr(
         }\r
         if (!EFI_ERROR(Status)) {\r
           ShellParameters->StdErr = TempHandle;\r
-          gST->StdErr = CreateSimpleTextOutOnFile(TempHandle, &gST->StandardErrorHandle);\r
+          gST->StdErr = CreateSimpleTextOutOnFile(TempHandle, &gST->StandardErrorHandle, gST->StdErr);\r
         }\r
       }\r
 \r
@@ -1031,20 +1148,20 @@ UpdateStdInStdOutStdErr(
           if (StrStr(StdOutFileName, L"NUL")==StdOutFileName) {\r
             //no-op\r
           } else if (!OutAppend && OutUnicode && !EFI_ERROR(Status)) {\r
-            //\r
-            // Write out the gUnicodeFileTag\r
-            //\r
-            Size = sizeof(CHAR16);\r
-            TagBuffer[0] = gUnicodeFileTag;\r
-            TagBuffer[1] = CHAR_NULL;\r
-            ShellInfoObject.NewEfiShellProtocol->WriteFile(TempHandle, &Size, TagBuffer);\r
+            Status = WriteFileTag (TempHandle);\r
           } else if (OutAppend) {\r
-            //\r
-            // Move to end of file\r
-            //\r
             Status = ShellInfoObject.NewEfiShellProtocol->GetFileSize(TempHandle, &FileSize);\r
             if (!EFI_ERROR(Status)) {\r
-              Status = ShellInfoObject.NewEfiShellProtocol->SetFilePosition(TempHandle, FileSize);\r
+              //\r
+              // When appending to a new unicode file, write the file tag.\r
+              // Otherwise (ie. when appending to a new ASCII file, or an\r
+              // existent file with any encoding), just seek to the end.\r
+              //\r
+              Status = (FileSize == 0 && OutUnicode) ?\r
+                         WriteFileTag (TempHandle) :\r
+                         ShellInfoObject.NewEfiShellProtocol->SetFilePosition (\r
+                                                                TempHandle,\r
+                                                                FileSize);\r
             }\r
           }\r
           if (!OutUnicode && !EFI_ERROR(Status)) {\r
@@ -1053,7 +1170,7 @@ UpdateStdInStdOutStdErr(
           }\r
           if (!EFI_ERROR(Status)) {\r
             ShellParameters->StdOut = TempHandle;\r
-            gST->ConOut = CreateSimpleTextOutOnFile(TempHandle, &gST->ConsoleOutHandle);\r
+            gST->ConOut = CreateSimpleTextOutOnFile(TempHandle, &gST->ConsoleOutHandle, gST->ConOut);\r
           }\r
         }\r
       }\r
@@ -1071,7 +1188,7 @@ UpdateStdInStdOutStdErr(
         TempHandle = CreateFileInterfaceEnv(StdOutVarName);\r
         ASSERT(TempHandle != NULL);\r
         ShellParameters->StdOut = TempHandle;\r
-        gST->ConOut = CreateSimpleTextOutOnFile(TempHandle, &gST->ConsoleOutHandle);\r
+        gST->ConOut = CreateSimpleTextOutOnFile(TempHandle, &gST->ConsoleOutHandle, gST->ConOut);\r
       }\r
 \r
       //\r
@@ -1087,7 +1204,7 @@ UpdateStdInStdOutStdErr(
         TempHandle = CreateFileInterfaceEnv(StdErrVarName);\r
         ASSERT(TempHandle != NULL);\r
         ShellParameters->StdErr = TempHandle;\r
-        gST->StdErr = CreateSimpleTextOutOnFile(TempHandle, &gST->StandardErrorHandle);\r
+        gST->StdErr = CreateSimpleTextOutOnFile(TempHandle, &gST->StandardErrorHandle, gST->StdErr);\r
       }\r
 \r
       //\r
@@ -1120,7 +1237,15 @@ UpdateStdInStdOutStdErr(
           &TempHandle,\r
           EFI_FILE_MODE_READ,\r
           0);\r
-        if (!InUnicode && !EFI_ERROR(Status)) {\r
+        if (InUnicode) {\r
+          //\r
+          // Chop off the 0xFEFF if it's there...\r
+          //\r
+          RemoveFileTag(&TempHandle);\r
+        } else if (!EFI_ERROR(Status)) {\r
+          //\r
+          // Create the ASCII->Unicode conversion layer\r
+          //\r
           TempHandle = CreateFileInterfaceFile(TempHandle, FALSE);\r
         }\r
         if (!EFI_ERROR(Status)) {\r
@@ -1135,8 +1260,15 @@ UpdateStdInStdOutStdErr(
   CalculateEfiHdrCrc(&gST->Hdr);\r
 \r
   if (gST->ConIn == NULL ||gST->ConOut == NULL) {\r
-    return (EFI_OUT_OF_RESOURCES);\r
+    Status = EFI_OUT_OF_RESOURCES;\r
   }\r
+\r
+  if (Status == EFI_NOT_FOUND) {\r
+    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_REDUNDA_REDIR), ShellInfoObject.HiiHandle);\r
+  } else if (EFI_ERROR(Status)) {\r
+    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_INVALID_REDIR), ShellInfoObject.HiiHandle);\r
+  }\r
+\r
   return (Status);\r
 }\r
 \r