]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/Common/SimpleFileParsing.c
There is a limitation on WINDOWS OS for the length of entire file path can’t be large...
[mirror_edk2.git] / BaseTools / Source / C / Common / SimpleFileParsing.c
index 5a7111c8ebbd1d6b023a63015498b51f7d0ef5e7..3978e6ed3c8e1b930e5d235f63c922e1ca3a74c0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
 http://opensource.org/licenses/bsd-license.php                                            \r
@@ -24,6 +24,7 @@ Abstract:
 #include <stdlib.h>\r
 #include <ctype.h>\r
 \r
+#include "CommonLib.h"\r
 #include "EfiUtilityMsgs.h"\r
 #include "SimpleFileParsing.h"\r
 \r
@@ -328,7 +329,7 @@ Notes:
   }\r
 \r
   if ((Len = t_strcmp (mGlobals.SourceFile.FileBufferPtr, Str)) > 0) {\r
-    if (isalnum (mGlobals.SourceFile.FileBufferPtr[Len])) {\r
+    if (isalnum ((int)mGlobals.SourceFile.FileBufferPtr[Len])) {\r
       return FALSE;\r
     }\r
 \r
@@ -543,26 +544,26 @@ Returns:
     return FALSE;\r
   }\r
 \r
-  if (isdigit (mGlobals.SourceFile.FileBufferPtr[0])) {\r
+  if (isdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) {\r
     //\r
     // Check for hex value\r
     //\r
     if ((mGlobals.SourceFile.FileBufferPtr[0] == T_CHAR_0) && (mGlobals.SourceFile.FileBufferPtr[1] == T_CHAR_LC_X)) {\r
-      if (!isxdigit (mGlobals.SourceFile.FileBufferPtr[2])) {\r
+      if (!isxdigit ((int)mGlobals.SourceFile.FileBufferPtr[2])) {\r
         return FALSE;\r
       }\r
 \r
       mGlobals.SourceFile.FileBufferPtr += 2;\r
       sscanf (mGlobals.SourceFile.FileBufferPtr, "%x", &Val);\r
       *Value = (UINT32) Val;\r
-      while (isxdigit (mGlobals.SourceFile.FileBufferPtr[0])) {\r
+      while (isxdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) {\r
         mGlobals.SourceFile.FileBufferPtr++;\r
       }\r
 \r
       return TRUE;\r
     } else {\r
       *Value = atoi (mGlobals.SourceFile.FileBufferPtr);\r
-      while (isdigit (mGlobals.SourceFile.FileBufferPtr[0])) {\r
+      while (isdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) {\r
         mGlobals.SourceFile.FileBufferPtr++;\r
       }\r
 \r
@@ -650,7 +651,7 @@ Returns:
   // Try to open the file locally, and if that fails try along our include paths.\r
   //\r
   strcpy (FoundFileName, SourceFile->FileName);\r
-  if ((SourceFile->Fptr = fopen (FoundFileName, "rb")) == NULL) {\r
+  if ((SourceFile->Fptr = fopen (LongFilePath (FoundFileName), "rb")) == NULL) {\r
     return STATUS_ERROR;\r
   }\r
   //\r
@@ -1239,7 +1240,7 @@ GetHexChars (
   UINT32  Len;\r
   Len = 0;\r
   while (!EndOfFile (&mGlobals.SourceFile) && (BufferLen > 0)) {\r
-    if (isxdigit (mGlobals.SourceFile.FileBufferPtr[0])) {\r
+    if (isxdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) {\r
       *Buffer = mGlobals.SourceFile.FileBufferPtr[0];\r
       Buffer++;\r
       Len++;\r