// Create the directory to create the file in\r
//\r
FileNameCopy = AllocateCopyPool (StrSize (FileName), FileName);\r
- if (FileName == NULL) {\r
+ if (FileNameCopy == NULL) {\r
return (EFI_OUT_OF_RESOURCES);\r
}\r
PathCleanUpDirectories (FileNameCopy);\r
// update the attribute\r
//\r
if (ResumeLocation != NULL) {\r
- if (*(ResumeLocation-1) == L'^') {\r
+ if ((ResumeLocation != mPostReplaceFormat2) && (*(ResumeLocation-1) == L'^')) {\r
//\r
// Move cursor back 1 position to overwrite the ^\r
//\r