To fix,
cd ...... works unnormally in shell USB CBI1 driver has no component name protocol git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2328 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -688,6 +688,32 @@ OpenRoot:
|
||||
FileName[StrLen (FileName) - 1] = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// If file name does not equal to "." or "..",
|
||||
// then we trim the leading/trailing blanks and trailing dots
|
||||
//
|
||||
if (StrCmp (FileName, L".") != 0 && StrCmp (FileName, L"..") != 0) {
|
||||
//
|
||||
// Trim leading blanks
|
||||
//
|
||||
Count = 0;
|
||||
for (TempFileName = FileName;
|
||||
*TempFileName != 0 && *TempFileName == L' ';
|
||||
TempFileName++) {
|
||||
Count++;
|
||||
}
|
||||
CutPrefix (FileName, Count);
|
||||
//
|
||||
// Trim trailing dots and blanks
|
||||
//
|
||||
for (TempFileName = FileName + StrLen (FileName) - 1;
|
||||
TempFileName >= FileName && (*TempFileName == L' ' || *TempFileName == L'.');
|
||||
TempFileName--) {
|
||||
;
|
||||
}
|
||||
*(TempFileName + 1) = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Attempt to open the file
|
||||
//
|
||||
@@ -738,8 +764,13 @@ OpenRoot:
|
||||
StrCat (NewPrivateFile->FileName, FileName + 1);
|
||||
} else {
|
||||
StrCpy (NewPrivateFile->FileName, NewPrivateFile->FilePath);
|
||||
StrCat (NewPrivateFile->FileName, L"\\");
|
||||
StrCat (NewPrivateFile->FileName, FileName);
|
||||
if (StrCmp (FileName, L"") != 0) {
|
||||
//
|
||||
// In case the filename becomes empty, especially after trimming dots and blanks
|
||||
//
|
||||
StrCat (NewPrivateFile->FileName, L"\\");
|
||||
StrCat (NewPrivateFile->FileName, FileName);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user