Changeset 85718 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
- Timestamp:
- Aug 12, 2020 4:09:12 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139865
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-133213 /vendor/edk2/current 103735-103757,103769-103776,129194-139864
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
r80721 r85718 418 418 @param[in] Count The count of bits enabled in Attribs. 419 419 @param[in] TimeZone The current time zone offset. 420 @param[in] ListUnfiltered TRUE to request listing the directory contents 421 unfiltered. 420 422 421 423 @retval SHELL_SUCCESS the printing was sucessful. … … 430 432 IN BOOLEAN *Found, 431 433 IN CONST UINTN Count, 432 IN CONST INT16 TimeZone 434 IN CONST INT16 TimeZone, 435 IN CONST BOOLEAN ListUnfiltered 433 436 ) 434 437 { … … 501 504 // 502 505 Status = gRT->GetTime(&LocalTime, NULL); 503 if (!EFI_ERROR (Status) ) {506 if (!EFI_ERROR (Status) && (LocalTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE)) { 504 507 if ((Node->Info->CreateTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE) && 505 508 (Node->Info->CreateTime.Month >= 1 && Node->Info->CreateTime.Month <= 12)) { … … 556 559 } 557 560 558 if (!Sfo && ShellStatus != SHELL_ABORTED ) {561 if (!Sfo && ShellStatus != SHELL_ABORTED && HeaderPrinted) { 559 562 PrintNonSfoFooter(FileCount, FileSize, DirCount); 560 563 } … … 603 606 &FoundOne, 604 607 Count, 605 TimeZone); 608 TimeZone, 609 FALSE); 606 610 607 611 // … … 620 624 621 625 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 } 623 641 } 624 642 … … 663 681 EFI_TIME TheTime; 664 682 CHAR16 *SearchString; 683 BOOLEAN ListUnfiltered; 665 684 666 685 Size = 0; … … 674 693 CurDir = NULL; 675 694 Count = 0; 695 ListUnfiltered = FALSE; 676 696 677 697 // … … 769 789 ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"ls"); 770 790 } 791 ListUnfiltered = TRUE; 771 792 // 772 793 // Copy to the 2 strings for starting path and file search string … … 809 830 // is listing ends with a directory, then we list all files in that directory 810 831 // 832 ListUnfiltered = TRUE; 811 833 StrnCatGrow(&SearchString, NULL, L"*", 0); 812 834 } else { … … 840 862 NULL, 841 863 Count, 842 TheTime.TimeZone 864 TheTime.TimeZone, 865 ListUnfiltered 843 866 ); 844 867 if (ShellStatus == SHELL_NOT_FOUND) {
Note:
See TracChangeset
for help on using the changeset viewer.