Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: ce88903374a9be9cbc15ee80b189cef5dc2e90d8
      
https://github.com/tianocore/edk2/commit/ce88903374a9be9cbc15ee80b189cef5dc2e90d8
  Author: Pierre Gondois <[email protected]>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Attrib.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/MkDir.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Parse.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c

  Log Message:
  -----------
  ShellPkg/UefiShellLevel2: Return if ShellCommandLineParse() failed

This patch aims to help breaking down the long function present in
the ShellPkg and reduce complexity/nested code and conditions.

Return directly if ShellCommandLineParse() returned an error Status.
In such case, the "Package" that should be allocated by
ShellCommandLineParse() is already freed in:
ShellCommandLineParse()
\-ShellCommandLineParseEx()
  \-InternalCommandLineParse()
so there is no need to free it with ShellCommandLineFreeVarList().

Note:
Cd:
Return directly if ShellCommandLineParse() returned an error
Status. The initial code was ignoring the error status.

Cp:
Only check for ShellGetExecutionBreakFlag() if
ShellCommandLineParse() returned successfully. If the command
line failed to be parsed, there should be no need to check for
the execution break flag.

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <[email protected]>


  Commit: 531b0aa00211656a738ee9612112b0dbce2658e1
      
https://github.com/tianocore/edk2/commit/531b0aa00211656a738ee9612112b0dbce2658e1
  Author: Pierre Gondois <[email protected]>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Attrib.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/MkDir.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Parse.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Vol.c

  Log Message:
  -----------
  ShellPkg/UefiShellLevel2: Extract MainCmdXXX() function

This patch aims to help breaking down the long function present in
the ShellPkg and reduce complexity/nested code and conditions.

Extract a MainCmdXXX() function for each shell command.
This command contains the possible operations the command aims
to operate. The ShellCommandRunXXX() function from which it
is extracted is only responsible of:
- initializing the shell/command environment
- parsing the command parameter and creating a Package
- freeing the Package

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <[email protected]>


  Commit: 5b1530e5adb3b24224a9a3a92b1dab6395d2dc58
      
https://github.com/tianocore/edk2/commit/5b1530e5adb3b24224a9a3a92b1dab6395d2dc58
  Author: Pierre Gondois <[email protected]>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Attrib.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/MkDir.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Parse.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Reset.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Set.c
    M ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c

  Log Message:
  -----------
  ShellPkg/UefiShellLevel2: Lower indentation level in MainCmdXXX()

This patch aims to help breaking down the long function present in
the ShellPkg and reduce complexity/nested code and conditions.

Lower the indentation level in the newly created MainCmdXXX()
functions.

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <[email protected]>


  Commit: 0b982813c756569be8f54f177bde090b76e9638e
      
https://github.com/tianocore/edk2/commit/0b982813c756569be8f54f177bde090b76e9638e
  Author: Pierre Gondois <[email protected]>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c

  Log Message:
  -----------
  ShellPkg/UefiShellLevel2/Ls: Flatten MainCmdLs()

Remove some of the success handling conditions to flatten
the MainCmdLs() function.

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <[email protected]>


  Commit: 8e822d5d262b63a17315f1156e2277b3837b59bf
      
https://github.com/tianocore/edk2/commit/8e822d5d262b63a17315f1156e2277b3837b59bf
  Author: Pierre Gondois <[email protected]>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c

  Log Message:
  -----------
  ShellPkg/UefiShellLevel2/Ls: Bail out early in MainCmdLs()

If RootPath is NULL, PrintLsOutput() will return an error code
of SHELL_OUT_OF_RESOURCES and not print anything:
PrintLsOutput()
\-StrnCatGrow()
  if (Source == NULL) {
    return (*Destination);
  }

Remove paths where FullPath ends up being NULL and bail out
early.

Signed-off-by: Pierre Gondois <[email protected]>


  Commit: 95476665c4fcb41a7eb43542e375830ada04d636
      
https://github.com/tianocore/edk2/commit/95476665c4fcb41a7eb43542e375830ada04d636
  Author: Pierre Gondois <[email protected]>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c

  Log Message:
  -----------
  ShellPkg/UefiShellLevel2/Ls: Remove ShellStatus check in MainCmdLs()

Remove a check against ShellStatus in MainCmdLs() as there are
two consecutive checks without any modification of ShellStatus.

Suggested-by: Leif Lindholm <[email protected]>
Signed-off-by: Pierre Gondois <[email protected]>


  Commit: 19c62fd3acd869c36dc514b5facb1ad797c366ae
      
https://github.com/tianocore/edk2/commit/19c62fd3acd869c36dc514b5facb1ad797c366ae
  Author: Pierre Gondois <[email protected]>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c

  Log Message:
  -----------
  ShellPkg/UefiShellLevel2: Fix CodeQl issues

Fix CodeQl issue triggered by the previous patches.
- Rm: FileList might be NULL

Signed-off-by: Pierre Gondois <[email protected]>


Compare: https://github.com/tianocore/edk2/compare/3af7eccf472d...19c62fd3acd8

To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to