This refactors 3 functions out of ShellCommandLib and puts them into a new library (but as 2 functions instead of 3). This allows for users outside of the shell itself to have access to these functions.

1) Remove the 3 functions out of the shell's internal library (ShellCommandLib)
2) Add a new library class (PathLib)
3) Add an instance of this class (BasePathLib)
4) Change all internal shell callers to use this new library class.

signed-off-by: jcarsey
reviewed-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11936 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey
2011-06-30 22:58:53 +00:00
parent f1518f6970
commit ab94587a7d
21 changed files with 245 additions and 173 deletions

View File

@ -108,7 +108,7 @@ ShellCommandRunCd (
ShellStatus = SHELL_NOT_FOUND;
} else {
Drive = GetFullyQualifiedPath(Directory);
ChopLastSlash(Drive);
PathRemoveLastItem(Drive);
}
if (ShellStatus == SHELL_SUCCESS && Drive != NULL) {
//
@ -130,7 +130,7 @@ ShellCommandRunCd (
ShellStatus = SHELL_NOT_FOUND;
} else {
Drive = GetFullyQualifiedPath(Directory);
while (ChopLastSlash(Drive)) ;
while (PathRemoveLastItem(Drive)) ;
}
if (ShellStatus == SHELL_SUCCESS && Drive != NULL) {
//
@ -150,7 +150,7 @@ ShellCommandRunCd (
ASSERT((Drive == NULL && DriveSize == 0) || (Drive != NULL));
Drive = StrnCatGrow(&Drive, &DriveSize, ShellGetCurrentDir(NULL), 0);
if (*Param1 == L'\\') {
while (ChopLastSlash(Drive)) ;
while (PathRemoveLastItem(Drive)) ;
Drive = StrnCatGrow(&Drive, &DriveSize, Param1+1, 0);
} else {
Drive = StrnCatGrow(&Drive, &DriveSize, Param1, 0);