VirtualBox

Ignore:
Timestamp:
Aug 12, 2020 4:09:12 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139865
Message:

Devices/EFI: Merge edk-stable202005 and make it build, bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c

    r80721 r85718  
    418418  @param[in] Count          The count of bits enabled in Attribs.
    419419  @param[in] TimeZone       The current time zone offset.
     420  @param[in] ListUnfiltered TRUE to request listing the directory contents
     421                            unfiltered.
    420422
    421423  @retval SHELL_SUCCESS     the printing was sucessful.
     
    430432  IN       BOOLEAN *Found,
    431433  IN CONST UINTN   Count,
    432   IN CONST INT16   TimeZone
     434  IN CONST INT16   TimeZone,
     435  IN CONST BOOLEAN ListUnfiltered
    433436  )
    434437{
     
    501504      //
    502505      Status = gRT->GetTime(&LocalTime, NULL);
    503       if (!EFI_ERROR (Status)) {
     506      if (!EFI_ERROR (Status) && (LocalTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE)) {
    504507        if ((Node->Info->CreateTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE) &&
    505508            (Node->Info->CreateTime.Month >= 1 && Node->Info->CreateTime.Month <= 12)) {
     
    556559    }
    557560
    558     if (!Sfo && ShellStatus != SHELL_ABORTED) {
     561    if (!Sfo && ShellStatus != SHELL_ABORTED && HeaderPrinted) {
    559562      PrintNonSfoFooter(FileCount, FileSize, DirCount);
    560563    }
     
    603606            &FoundOne,
    604607            Count,
    605             TimeZone);
     608            TimeZone,
     609            FALSE);
    606610
    607611          //
     
    620624
    621625  if (Found == NULL && !FoundOne) {
    622     return (SHELL_NOT_FOUND);
     626    if (ListUnfiltered) {
     627      //
     628      // When running "ls" without any filtering request, avoid outputing
     629      // "File not found" when the directory is entirely empty, but print
     630      // header and footer stating "0 File(s), 0 Dir(s)".
     631      //
     632      if (!Sfo) {
     633        PrintNonSfoHeader (RootPath);
     634        if (ShellStatus != SHELL_ABORTED) {
     635          PrintNonSfoFooter (FileCount, FileSize, DirCount);
     636        }
     637      }
     638    } else {
     639      return (SHELL_NOT_FOUND);
     640    }
    623641  }
    624642
     
    663681  EFI_TIME      TheTime;
    664682  CHAR16        *SearchString;
     683  BOOLEAN       ListUnfiltered;
    665684
    666685  Size                = 0;
     
    674693  CurDir              = NULL;
    675694  Count               = 0;
     695  ListUnfiltered      = FALSE;
    676696
    677697  //
     
    769789            ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"ls");
    770790          }
     791          ListUnfiltered = TRUE;
    771792          //
    772793          // Copy to the 2 strings for starting path and file search string
     
    809830              // is listing ends with a directory, then we list all files in that directory
    810831              //
     832              ListUnfiltered = TRUE;
    811833              StrnCatGrow(&SearchString, NULL, L"*", 0);
    812834            } else {
     
    840862            NULL,
    841863            Count,
    842             TheTime.TimeZone
     864            TheTime.TimeZone,
     865            ListUnfiltered
    843866           );
    844867          if (ShellStatus == SHELL_NOT_FOUND) {
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette