summaryrefslogtreecommitdiff
path: root/Tools/Source/TianoTools
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-30 08:09:57 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-30 08:09:57 +0000
commit2eaa5ba11d2439b323e113f45c7eb702b873f790 (patch)
tree2589dd3f4f738394abfe325a2bf7a630b11e988a /Tools/Source/TianoTools
parent563671d4d7c483a53535475a2737eba71372d7a8 (diff)
downloadedk2-platforms-2eaa5ba11d2439b323e113f45c7eb702b873f790.tar.xz
FlashMap can not work correctly in unix GCC because the windows path char "\" exist in parameter.
I fix it by adding a NormalizePath function. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1152 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Source/TianoTools')
-rw-r--r--Tools/Source/TianoTools/FlashMap/FlashMap.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/Tools/Source/TianoTools/FlashMap/FlashMap.c b/Tools/Source/TianoTools/FlashMap/FlashMap.c
index 8e8237507d..191e899ecc 100644
--- a/Tools/Source/TianoTools/FlashMap/FlashMap.c
+++ b/Tools/Source/TianoTools/FlashMap/FlashMap.c
@@ -87,6 +87,11 @@ Usage (
VOID
);
+char*
+NormalizePath (
+ char* OldPathName
+ );
+
int
main (
int argc,
@@ -249,8 +254,8 @@ Returns:
// Open the file, determine the size, then read it in and write
// it back out.
//
- if ((InFptr = fopen (FileNames->Str, "rb")) == NULL) {
- Error (NULL, 0, 0, FileNames->Str, "failed to open input file for reading");
+ if ((InFptr = fopen (NormalizePath(FileNames->Str), "rb")) == NULL) {
+ Error (NULL, 0, 0, NormalizePath(FileNames->Str), "failed to open input file for reading");
goto Done;
}
fseek (InFptr, 0, SEEK_END);
@@ -739,3 +744,24 @@ Returns:
fprintf (stdout, "%s\n", Msg[i]);
}
}
+
+char*
+NormalizePath (
+ char* OldPathName
+ )
+{
+ char* Visitor;
+
+ if (OldPathName == NULL) {
+ return NULL;
+ }
+
+ Visitor = OldPathName;
+ while (*Visitor != '\0') {
+ if (*Visitor == '\\') {
+ *Visitor = '/';
+ }
+ }
+
+ return Visitor;
+} \ No newline at end of file