//\r
// Add the null termination over the 0x0D\r
//\r
- InputBuffer[CharsToCopy - 1] = '\0';\r
+ if (InputBuffer[CharsToCopy - 1] == '\r') {\r
+\r
+ InputBuffer[CharsToCopy - 1] = '\0';\r
+\r
+ } else {\r
+\r
+ InputBuffer[CharsToCopy] = '\0';\r
+\r
+ }\r
\r
//\r
// Increment the current file pointer (include the 0x0A)\r
#include "EfiCompress.h"\r
#include "WinNtInclude.h"\r
\r
+//\r
+// Different file separater for Linux and Windows\r
+//\r
+#ifdef __GNUC__\r
+#define FILE_SEP_CHAR '/'\r
+#define FILE_SEP_STRING "/"\r
+#else\r
+#define FILE_SEP_CHAR '\\'\r
+#define FILE_SEP_STRING "\\"\r
+#endif\r
+\r
static UINT32 MaxFfsAlignment = 0;\r
//\r
// Local function prototypes\r
// Copy the file name for the path of the sym file and truncate the name portion.\r
//\r
strcpy (SymFileName, Buffer);\r
- Ptr = strrchr (SymFileName, '\\');\r
+ Ptr = strrchr (SymFileName, FILE_SEP_CHAR);\r
assert (Ptr);\r
Ptr[0] = 0;\r
\r
// Add the symbol file name and extension to the file path.\r
//\r
strcat (Buffer, ".sym");\r
- strcat (SymFileName, "\\");\r
+ strcat (SymFileName, FILE_SEP_CHAR);\r
strcat (SymFileName, Buffer);\r
} else {\r
//\r