summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-11-07 03:03:06 +0000
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-11-07 03:03:06 +0000
commit1d940d05b5105cbbcfa0c572927aec49499dc35f (patch)
tree3bf87ef6d5699fd1cd80a83c8343ba6d04899f4d
parentb51f14f4d6ab20a6ad5de08bd001c44ad59dea18 (diff)
downloadedk2-platforms-1d940d05b5105cbbcfa0c572927aec49499dc35f.tar.xz
Update ParseInf to resolve different line separator between WINDOWS and LINUX (\r\n vs. \n). Update GenFvImage to resolve different file separator between WINDOWS and LINUX (\ vs. /). Add variable initialize for SymImageSize.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1908 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--Tools/CCode/Source/Common/ParseInf.c10
-rw-r--r--Tools/CCode/Source/GenFvImage/GenFvImageExe.c2
-rw-r--r--Tools/CCode/Source/GenFvImage/GenFvImageLib.c15
3 files changed, 23 insertions, 4 deletions
diff --git a/Tools/CCode/Source/Common/ParseInf.c b/Tools/CCode/Source/Common/ParseInf.c
index de0ffd85c7..6f5900e897 100644
--- a/Tools/CCode/Source/Common/ParseInf.c
+++ b/Tools/CCode/Source/Common/ParseInf.c
@@ -116,7 +116,15 @@ Returns:
//
// Add the null termination over the 0x0D
//
- InputBuffer[CharsToCopy - 1] = '\0';
+ if (InputBuffer[CharsToCopy - 1] == '\r') {
+
+ InputBuffer[CharsToCopy - 1] = '\0';
+
+ } else {
+
+ InputBuffer[CharsToCopy] = '\0';
+
+ }
//
// Increment the current file pointer (include the 0x0A)
diff --git a/Tools/CCode/Source/GenFvImage/GenFvImageExe.c b/Tools/CCode/Source/GenFvImage/GenFvImageExe.c
index d0117b8ae9..ce56299f1f 100644
--- a/Tools/CCode/Source/GenFvImage/GenFvImageExe.c
+++ b/Tools/CCode/Source/GenFvImage/GenFvImageExe.c
@@ -126,7 +126,7 @@ Returns:
CHAR8 SymFileNameBuffer[_MAX_PATH];
CHAR8 *SymFileName;
UINT8 *SymImage;
- UINTN SymImageSize;
+ UINTN SymImageSize = 0;
CHAR8 *CurrentSymString;
FvFileName = FvFileNameBuffer;
diff --git a/Tools/CCode/Source/GenFvImage/GenFvImageLib.c b/Tools/CCode/Source/GenFvImage/GenFvImageLib.c
index 45d4c8e848..06500ef373 100644
--- a/Tools/CCode/Source/GenFvImage/GenFvImageLib.c
+++ b/Tools/CCode/Source/GenFvImage/GenFvImageLib.c
@@ -48,6 +48,17 @@ Abstract:
#include "EfiCompress.h"
#include "WinNtInclude.h"
+//
+// Different file separater for Linux and Windows
+//
+#ifdef __GNUC__
+#define FILE_SEP_CHAR '/'
+#define FILE_SEP_STRING "/"
+#else
+#define FILE_SEP_CHAR '\\'
+#define FILE_SEP_STRING "\\"
+#endif
+
static UINT32 MaxFfsAlignment = 0;
//
// Local function prototypes
@@ -1374,7 +1385,7 @@ Returns:
// Copy the file name for the path of the sym file and truncate the name portion.
//
strcpy (SymFileName, Buffer);
- Ptr = strrchr (SymFileName, '\\');
+ Ptr = strrchr (SymFileName, FILE_SEP_CHAR);
assert (Ptr);
Ptr[0] = 0;
@@ -1411,7 +1422,7 @@ Returns:
// Add the symbol file name and extension to the file path.
//
strcat (Buffer, ".sym");
- strcat (SymFileName, "\\");
+ strcat (SymFileName, FILE_SEP_CHAR);
strcat (SymFileName, Buffer);
} else {
//