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:
@@ -529,7 +529,7 @@ EfiShellGetDevicePathFromFilePath(
|
||||
StrCpy(NewPath, Cwd);
|
||||
if (*Path == L'\\') {
|
||||
Path++;
|
||||
while (ChopLastSlash(NewPath)) ;
|
||||
while (PathRemoveLastItem(NewPath)) ;
|
||||
}
|
||||
StrCat(NewPath, Path);
|
||||
DevicePathForReturn = EfiShellGetDevicePathFromFilePath(NewPath);
|
||||
@@ -2232,7 +2232,7 @@ EfiShellFindFiles(
|
||||
}
|
||||
StrCpy(PatternCopy, FilePattern);
|
||||
|
||||
PatternCopy = CleanPath(PatternCopy);
|
||||
PatternCopy = PathCleanUpDirectories(PatternCopy);
|
||||
|
||||
Count = StrStr(PatternCopy, L":") - PatternCopy;
|
||||
Count += 2;
|
||||
@@ -2293,7 +2293,7 @@ EfiShellOpenFileList(
|
||||
CONST CHAR16 *CurDir;
|
||||
BOOLEAN Found;
|
||||
|
||||
ShellCommandCleanPath(Path);
|
||||
PathCleanUpDirectories(Path);
|
||||
|
||||
Path2Size = 0;
|
||||
Path2 = NULL;
|
||||
@@ -2315,7 +2315,7 @@ EfiShellOpenFileList(
|
||||
StrnCatGrow(&Path2, &Path2Size, CurDir, 0);
|
||||
if (*Path == L'\\') {
|
||||
Path++;
|
||||
while (ChopLastSlash(Path2)) ;
|
||||
while (PathRemoveLastItem(Path2)) ;
|
||||
}
|
||||
ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL));
|
||||
StrnCatGrow(&Path2, &Path2Size, Path, 0);
|
||||
@@ -2324,7 +2324,7 @@ EfiShellOpenFileList(
|
||||
StrnCatGrow(&Path2, NULL, Path, 0);
|
||||
}
|
||||
|
||||
CleanPath (Path2);
|
||||
PathCleanUpDirectories (Path2);
|
||||
|
||||
//
|
||||
// do the search
|
||||
@@ -2677,7 +2677,7 @@ EfiShellSetCurDir(
|
||||
DirectoryName = StrnCatGrow(&DirectoryName, NULL, Dir, 0);
|
||||
ASSERT(DirectoryName != NULL);
|
||||
|
||||
CleanPath(DirectoryName);
|
||||
PathCleanUpDirectories(DirectoryName);
|
||||
|
||||
if (FileSystem == NULL) {
|
||||
//
|
||||
|
Reference in New Issue
Block a user