X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellLevel2CommandsLib%2FUefiShellLevel2CommandsLib.c;h=ce3d87ba502f745bf9e9a17f85e4c71c455bf053;hb=ab94587a7d2cd89695f9190420daceae0d2b7446;hp=11a15b5045903aaeaec013ee30968ebd4c560528;hpb=b54fd049bdfa0d9520a40d8a1783aa681b40d751;p=mirror_edk2.git diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c index 11a15b5045..ce3d87ba50 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c @@ -77,7 +77,7 @@ ShellLevel2CommandsLibConstructor ( // if shell level is less than 2 do nothing // if (PcdGet8(PcdShellSupportLevel) < 2) { - return (EFI_UNSUPPORTED); + return (EFI_SUCCESS); } gShellLevel2HiiHandle = HiiAddPackages (&gShellLevel2HiiGuid, gImageHandle, UefiShellLevel2CommandsLibStrings, NULL); @@ -111,6 +111,7 @@ ShellLevel2CommandsLibConstructor ( ShellCommandRegisterAlias(L"mkdir", L"md"); ShellCommandRegisterAlias(L"cd ..", L"cd.."); ShellCommandRegisterAlias(L"cd \\", L"cd\\"); + ShellCommandRegisterAlias(L"ren", L"mv"); // // These are installed in level 2 or 3... // @@ -153,54 +154,6 @@ ShellLevel2CommandsLibDestructor ( return (EFI_SUCCESS); } -/** - Function to clean up paths. Removes the following items: - single periods in the path (no need for the current directory tag) - double periods in the path and removes a single parent directory. - - This will be done inline and the resultant string may be be 'too big'. - - @param[in] PathToReturn The pointer to the string containing the path. - - @return PathToReturn is always returned. -**/ -CHAR16* -EFIAPI -CleanPath( - IN CHAR16 *PathToReturn - ) -{ - CHAR16 *TempString; - UINTN TempSize; - if (PathToReturn==NULL) { - return(NULL); - } - // - // Fix up the directory name - // - while ((TempString = StrStr(PathToReturn, L"\\..\\")) != NULL) { - *TempString = CHAR_NULL; - TempString += 4; - ChopLastSlash(PathToReturn); - TempSize = StrSize(TempString); - CopyMem(PathToReturn+StrLen(PathToReturn), TempString, TempSize); - } - if ((TempString = StrStr(PathToReturn, L"\\..")) != NULL && *(TempString + 3) == CHAR_NULL) { - *TempString = CHAR_NULL; - ChopLastSlash(PathToReturn); - } - while ((TempString = StrStr(PathToReturn, L"\\.\\")) != NULL) { - *TempString = CHAR_NULL; - TempString += 2; - TempSize = StrSize(TempString); - CopyMem(PathToReturn+StrLen(PathToReturn), TempString, TempSize); - } - if ((TempString = StrStr(PathToReturn, L"\\.")) != NULL && *(TempString + 2) == CHAR_NULL) { - *TempString = CHAR_NULL; - } - return (PathToReturn); -} - /** returns a fully qualified directory (contains a map drive at the begining) path from a unknown directory path. @@ -243,7 +196,7 @@ GetFullyQualifiedPath( } StrnCatGrow(&PathToReturn, &Size, Path, 0); - CleanPath(PathToReturn); + PathCleanUpDirectories(PathToReturn); while (PathToReturn[StrLen(PathToReturn)-1] == L'*') { PathToReturn[StrLen(PathToReturn)-1] = CHAR_NULL;