]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/Common/ParseInf.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 / ParseInf.c
index 385758f8366f5412b8f9a93510e84a9e13f49dde..00ae0e65a10b8aee9fa193689e79dc3c4c746558 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
 /** @file\r
 \r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\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
 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
@@ -25,6 +25,7 @@ Abstract:
 #include <stdlib.h>\r
 #include "EfiUtilityMsgs.h"\r
 #include "ParseInf.h"\r
 #include <stdlib.h>\r
 #include "EfiUtilityMsgs.h"\r
 #include "ParseInf.h"\r
+#include "CommonLib.h"\r
 \r
 CHAR8 *\r
 ReadLine (\r
 \r
 CHAR8 *\r
 ReadLine (\r
@@ -46,7 +47,7 @@ Routine Description:
 Arguments:\r
 \r
   InputFile     Memory file image.\r
 Arguments:\r
 \r
   InputFile     Memory file image.\r
-  InputBuffer   Buffer to read into, must be _MAX_PATH size.\r
+  InputBuffer   Buffer to read into, must be MaxLength size.\r
   MaxLength     The maximum size of the input buffer.\r
 \r
 Returns:\r
   MaxLength     The maximum size of the input buffer.\r
 \r
 Returns:\r
@@ -165,7 +166,7 @@ Returns:
 \r
 --*/\r
 {\r
 \r
 --*/\r
 {\r
-  CHAR8 InputBuffer[_MAX_PATH];\r
+  CHAR8 InputBuffer[MAX_LONG_FILE_PATH];\r
   CHAR8 *CurrentToken;\r
 \r
   //\r
   CHAR8 *CurrentToken;\r
 \r
   //\r
@@ -188,7 +189,7 @@ Returns:
     //\r
     // Read a line\r
     //\r
     //\r
     // Read a line\r
     //\r
-    ReadLine (InputFile, InputBuffer, _MAX_PATH);\r
+    ReadLine (InputFile, InputBuffer, MAX_LONG_FILE_PATH);\r
 \r
     //\r
     // Check if the section is found\r
 \r
     //\r
     // Check if the section is found\r
@@ -222,7 +223,7 @@ Arguments:
   Section   The section to search for, a string within [].\r
   Token     The token to search for, e.g. EFI_PEIM_RECOVERY, followed by an = in the INF file.\r
   Instance  The instance of the token to search for.  Zero is the first instance.\r
   Section   The section to search for, a string within [].\r
   Token     The token to search for, e.g. EFI_PEIM_RECOVERY, followed by an = in the INF file.\r
   Instance  The instance of the token to search for.  Zero is the first instance.\r
-  Value     The string that holds the value following the =.  Must be _MAX_PATH in size.\r
+  Value     The string that holds the value following the =.  Must be MAX_LONG_FILE_PATH in size.\r
 \r
 Returns:\r
 \r
 \r
 Returns:\r
 \r
@@ -234,7 +235,7 @@ Returns:
 \r
 --*/\r
 {\r
 \r
 --*/\r
 {\r
-  CHAR8   InputBuffer[_MAX_PATH];\r
+  CHAR8   InputBuffer[MAX_LONG_FILE_PATH];\r
   CHAR8   *CurrentToken;\r
   CHAR8   *Delimiter;\r
   BOOLEAN ParseError;\r
   CHAR8   *CurrentToken;\r
   CHAR8   *Delimiter;\r
   BOOLEAN ParseError;\r
@@ -274,7 +275,7 @@ Returns:
       //\r
       // Read a line from the file\r
       //\r
       //\r
       // Read a line from the file\r
       //\r
-      if (ReadLine (InputFile, InputBuffer, _MAX_PATH) == NULL) {\r
+      if (ReadLine (InputFile, InputBuffer, MAX_LONG_FILE_PATH) == NULL) {\r
         //\r
         // Error reading from input file\r
         //\r
         //\r
         // Error reading from input file\r
         //\r
@@ -604,7 +605,7 @@ Routine Description:
 Arguments:\r
 \r
   InputFile     Stream pointer.\r
 Arguments:\r
 \r
   InputFile     Stream pointer.\r
-  InputBuffer   Buffer to read into, must be _MAX_PATH size.\r
+  InputBuffer   Buffer to read into, must be MAX_LONG_FILE_PATH size.\r
 \r
 Returns:\r
 \r
 \r
 Returns:\r
 \r
@@ -624,7 +625,7 @@ Returns:
   //\r
   // Read a line\r
   //\r
   //\r
   // Read a line\r
   //\r
-  if (fgets (InputBuffer, _MAX_PATH, InputFile) == NULL) {\r
+  if (fgets (InputBuffer, MAX_LONG_FILE_PATH, InputFile) == NULL) {\r
     return NULL;\r
   }\r
   //\r
     return NULL;\r
   }\r
   //\r
@@ -670,7 +671,7 @@ Returns:
 \r
 --*/\r
 {\r
 \r
 --*/\r
 {\r
-  CHAR8 InputBuffer[_MAX_PATH];\r
+  CHAR8 InputBuffer[MAX_LONG_FILE_PATH];\r
   CHAR8 *CurrentToken;\r
 \r
   //\r
   CHAR8 *CurrentToken;\r
 \r
   //\r