summaryrefslogtreecommitdiff
path: root/Tools/CCode/Source/StrGather/StrGather.c
diff options
context:
space:
mode:
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-30 09:17:24 +0000
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-30 09:17:24 +0000
commita7081d204ab70fbdb98ace6e678e5a899c0145d6 (patch)
tree0665cccf27a71ac3f9811fd4a811fd83e495a25f /Tools/CCode/Source/StrGather/StrGather.c
parent8de9f9e154c4263dffff0be310b891796e78e420 (diff)
downloadedk2-platforms-a7081d204ab70fbdb98ace6e678e5a899c0145d6.tar.xz
To fix tool StrGather.exe can not work correctly in Linux environment.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1863 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/CCode/Source/StrGather/StrGather.c')
-rw-r--r--Tools/CCode/Source/StrGather/StrGather.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/Tools/CCode/Source/StrGather/StrGather.c b/Tools/CCode/Source/StrGather/StrGather.c
index 9eb5c5a19e..8908b430a1 100644
--- a/Tools/CCode/Source/StrGather/StrGather.c
+++ b/Tools/CCode/Source/StrGather/StrGather.c
@@ -48,6 +48,16 @@ Abstract:
#define MODE_PARSE 1
#define MODE_SCAN 2
#define MODE_DUMP 3
+//
+// 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
//
// We keep a linked list of these for the source files we process
@@ -1583,8 +1593,8 @@ ProcessArgs (
}
strcpy (NewList->Str, Argv[1]);
- if (NewList->Str[strlen (NewList->Str) - 1] != '\\') {
- strcat (NewList->Str, "\\");
+ if (NewList->Str[strlen (NewList->Str) - 1] != FILE_SEP_CHAR) {
+ strcat (NewList->Str, FILE_SEP_STRING);
}
//
// Add it to our linked list