]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/TianoTools/FlashMap/FlashMap.c
Miss loop variable incremental, otherwise, will cause dead loop.
[mirror_edk2.git] / Tools / Source / TianoTools / FlashMap / FlashMap.c
index ce20157795a0d03111186780fc0b6d75a45b7194..7ce9a575f8d9542c388b0d399f69786dd9f8d928 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c)  2004-2005 Intel Corporation. All rights reserved\r
-This software and associated documentation (if any) is furnished\r
-under a license and may only be used or copied in accordance\r
-with the terms of the license. Except as permitted by such\r
-license, no part of this software or documentation may be\r
-reproduced, stored in a retrieval system, or transmitted in any\r
-form or by any means without the express written consent of\r
-Intel Corporation.\r
+Copyright (c)  2004-2006 Intel Corporation. All rights reserved\r
+This program and the accompanying materials are licensed and made available \r
+under the terms and conditions of the BSD License which accompanies this \r
+distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 Module Name:\r
 \r
@@ -24,8 +24,8 @@ Abstract:
 #include <string.h>\r
 #include <stdlib.h>\r
 #include <ctype.h>\r
-#include <UefiBaseTypes.h>\r
-#include <Base.h>\r
+\r
+#include <Common/UefiBaseTypes.h>\r
 \r
 #include "EfiUtilityMsgs.h"\r
 #include "Microcode.h"\r
@@ -87,6 +87,11 @@ Usage (
   VOID\r
   );\r
 \r
+char* \r
+NormalizePath (\r
+  char* OldPathName\r
+  );\r
+\r
 int\r
 main (\r
   int   argc,\r
@@ -249,8 +254,8 @@ Returns:
     // Open the file, determine the size, then read it in and write\r
     // it back out.\r
     //\r
-    if ((InFptr = fopen (FileNames->Str, "rb")) == NULL) {\r
-      Error (NULL, 0, 0, FileNames->Str, "failed to open input file for reading");\r
+    if ((InFptr = fopen (NormalizePath(FileNames->Str), "rb")) == NULL) {\r
+      Error (NULL, 0, 0, NormalizePath(FileNames->Str), "failed to open input file for reading");\r
       goto Done;\r
     }\r
     fseek (InFptr, 0, SEEK_END);\r
@@ -739,3 +744,25 @@ Returns:
     fprintf (stdout, "%s\n", Msg[i]);\r
   }\r
 }\r
+\r
+char* \r
+NormalizePath (\r
+  char* OldPathName\r
+  )\r
+{\r
+  char* Visitor;\r
+  \r
+  if (OldPathName == NULL) {\r
+    return NULL;\r
+  }\r
+  \r
+  Visitor = OldPathName;\r
+  while (*Visitor != '\0') {\r
+    if (*Visitor == '\\') {\r
+      *Visitor = '/';\r
+    }\r
+    Visitor++;\r
+  }\r
+  \r
+  return Visitor;\r
+}
\ No newline at end of file