summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4b2e068)
[NT32] Emulator can't run when built with /O1
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2512
6f19259b-4bc3-4df7-8a09-
765794883524
- for (Pointer = Str; *(Pointer + Count); Pointer++) {\r
- *Pointer = *(Pointer + Count);\r
+ if (Count != 0) {\r
+ for (Pointer = Str; *(Pointer + Count); Pointer++) {\r
+ *Pointer = *(Pointer + Count);\r
+ }\r
+ *Pointer = *(Pointer + Count); \r
-\r
- *Pointer = *(Pointer + Count);\r
CHAR16 TempChar;\r
DWORD LastError;\r
UINTN Count;\r
CHAR16 TempChar;\r
DWORD LastError;\r
UINTN Count;\r
- BOOLEAN TrailingDash;\r
BOOLEAN LoopFinish;\r
UINTN InfoSize;\r
EFI_FILE_INFO *Info;\r
\r
BOOLEAN LoopFinish;\r
UINTN InfoSize;\r
EFI_FILE_INFO *Info;\r
\r
- TrailingDash = FALSE;\r
-\r
//\r
// Check for obvious invalid parameters.\r
//\r
//\r
// Check for obvious invalid parameters.\r
//\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
+ //\r
+ // Init local variables\r
+ //\r
PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
PrivateRoot = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (PrivateFile->SimpleFileSystem);\r
NewPrivateFile = NULL;\r
\r
PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
PrivateRoot = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (PrivateFile->SimpleFileSystem);\r
NewPrivateFile = NULL;\r
\r
+ //\r
+ // Allocate buffer for FileName as the passed in FileName may be read only\r
+ //\r
+ Status = gBS->AllocatePool (\r
+ EfiBootServicesData,\r
+ StrSize (FileName),\r
+ &TempFileName\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+ StrCpy (TempFileName, FileName);\r
+ FileName = TempFileName;\r
+\r
//\r
// BUGBUG: assume an open of root\r
// if current location, return current data\r
//\r
// BUGBUG: assume an open of root\r
// if current location, return current data\r
}\r
\r
if (FileName[StrLen (FileName) - 1] == L'\\') {\r
}\r
\r
if (FileName[StrLen (FileName) - 1] == L'\\') {\r
FileName[StrLen (FileName) - 1] = 0;\r
}\r
\r
FileName[StrLen (FileName) - 1] = 0;\r
}\r
\r
- if (TrailingDash) {\r
- FileName[StrLen (FileName) + 1] = 0;\r
- FileName[StrLen (FileName)] = L'\\';\r
- }\r
+ gBS->FreePool (FileName);\r
\r
if (EFI_ERROR (Status)) {\r
if (NewPrivateFile) {\r
\r
if (EFI_ERROR (Status)) {\r
if (NewPrivateFile) {\r