fixed one bug causing "sct -u" failure when running at twice or more times.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8622 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2009-06-22 07:55:37 +00:00
parent ac0f89ba97
commit 9485089dd5
1 changed files with 23 additions and 12 deletions

View File

@ -1,6 +1,6 @@
/**@file
Copyright (c) 2006 - 2008, Intel Corporation
Copyright (c) 2006 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -2469,6 +2469,7 @@ Returns:
//
// Make full pathname from new filename and rootpath.
//
if (NewFileInfo->FileName[0] == '\\') {
Size = StrSize (PrivateRoot->FilePath);
Size += StrSize (L"\\");
Size += StrSize (NewFileInfo->FileName);
@ -2480,9 +2481,19 @@ Returns:
StrCpy (NewFileName, PrivateRoot->FilePath);
StrCat (NewFileName, L"\\");
if (NewFileInfo->FileName[0] == '\\') {
StrCat (NewFileName, NewFileInfo->FileName + 1);
} else {
Size = StrSize (PrivateFile->FilePath);
Size += StrSize (L"\\");
Size += StrSize (NewFileInfo->FileName);
NewFileName = AllocatePool (Size);
if (NewFileName == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
}
StrCpy (NewFileName, PrivateFile->FilePath);
StrCat (NewFileName, L"\\");
StrCat (NewFileName, NewFileInfo->FileName);
}