/** @file\r
Implements filebuffer interface functions.\r
\r
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>\r
+ Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved. <BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
// backup the old screen attributes\r
//\r
Orig = MainEditor.ColorAttributes;\r
+ New.Data = 0;\r
New.Colors.Foreground = Orig.Colors.Background;\r
New.Colors.Background = Orig.Colors.Foreground;\r
\r
\r
CHAR16 *Buffer;\r
UINTN Limit;\r
- CHAR16 PrintLine[200];\r
+ CHAR16 *PrintLine;\r
+ CHAR16 *PrintLine2;\r
+ UINTN BufLen; \r
\r
//\r
// print start from correct character\r
Limit = 0;\r
}\r
\r
- StrnCpy (PrintLine, Buffer, MIN(MIN(Limit,MainEditor.ScreenSize.Column), 200));\r
+ BufLen = (MainEditor.ScreenSize.Column + 1) * sizeof (CHAR16);\r
+ PrintLine = AllocatePool (BufLen);\r
+ ASSERT (PrintLine != NULL);\r
+\r
+ StrnCpy (PrintLine, Buffer, MIN(Limit, MainEditor.ScreenSize.Column));\r
for (; Limit < MainEditor.ScreenSize.Column; Limit++) {\r
PrintLine[Limit] = L' ';\r
}\r
\r
PrintLine[MainEditor.ScreenSize.Column] = CHAR_NULL;\r
\r
+ PrintLine2 = AllocatePool (BufLen * 2);\r
+ ASSERT (PrintLine2 != NULL);\r
+\r
+ ShellCopySearchAndReplace(PrintLine, PrintLine2, BufLen * 2, L"%", L"^%", FALSE, FALSE);\r
+\r
ShellPrintEx (\r
0,\r
(INT32)Row - 1,\r
L"%s",\r
- PrintLine\r
+ PrintLine2\r
);\r
\r
+ FreePool (PrintLine);\r
+ FreePool (PrintLine2);\r
+\r
return EFI_SUCCESS;\r
}\r
\r
/**\r
Delete a char in line\r
\r
- @param[in,out] Line The line to delete in.\r
- @param[in] Pos Position to delete the char at ( start from 0 ).\r
+ @param[in, out] Line The line to delete in.\r
+ @param[in] Pos Position to delete the char at ( start from 0 ).\r
**/\r
VOID\r
EFIAPI\r
/**\r
Concatenate Src into Dest.\r
\r
- @param[in,out] Dest Destination string\r
- @param[in] Src Src String.\r
+ @param[in, out] Dest Destination string\r
+ @param[in] Src Src String.\r
**/\r
VOID\r
EFIAPI\r
//\r
// found\r
//\r
- if (Found == TRUE) {\r
+ if (Found) {\r
Column = (Position - 1) + FileBuffer.FilePosition.Column + Offset;\r
Row = FileBuffer.FilePosition.Row;\r
} else {\r
Found = TRUE;\r
} \r
\r
- if (Found == TRUE) {\r
+ if (Found) {\r
//\r
// found\r
//\r