From 9485089dd5d8cd2e7abf6b0bb05414f423470764 Mon Sep 17 00:00:00 2001 From: vanjeff Date: Mon, 22 Jun 2009 07:55:37 +0000 Subject: 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 --- .../WinNtSimpleFileSystem.c | 35 ++++++++++++++-------- 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'Nt32Pkg') diff --git a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c index 1abb84185e..a5559bfc03 100644 --- a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c +++ b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c @@ -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,20 +2469,31 @@ Returns: // // Make full pathname from new filename and rootpath. // - Size = StrSize (PrivateRoot->FilePath); - Size += StrSize (L"\\"); - Size += StrSize (NewFileInfo->FileName); - NewFileName = AllocatePool (Size); - if (NewFileName == NULL) { - Status = EFI_OUT_OF_RESOURCES; - goto Done; - } - - StrCpy (NewFileName, PrivateRoot->FilePath); - StrCat (NewFileName, L"\\"); if (NewFileInfo->FileName[0] == '\\') { + Size = StrSize (PrivateRoot->FilePath); + Size += StrSize (L"\\"); + Size += StrSize (NewFileInfo->FileName); + NewFileName = AllocatePool (Size); + if (NewFileName == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto Done; + } + + StrCpy (NewFileName, PrivateRoot->FilePath); + StrCat (NewFileName, L"\\"); 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); } -- cgit v1.2.3