]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/VfrCompile: Remove the MAX_PATH limitation
authorDandan Bi <dandan.bi@intel.com>
Fri, 28 Jul 2017 08:19:22 +0000 (16:19 +0800)
committerHao Wu <hao.a.wu@intel.com>
Fri, 4 Aug 2017 06:32:42 +0000 (14:32 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=579

Since we have already used LongFilePath() to convert
file path, so we can remove the MAX_PATH limitation.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Daniel Díaz <daniel.diaz@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
BaseTools/Source/C/VfrCompile/EfiVfr.h
BaseTools/Source/C/VfrCompile/VfrCompiler.cpp

index d187902e2bdaf9af09d065ba592198622b8de601..10d12578d308ea089c3e92d425e21b9a94a9cf7d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Defines and prototypes for the UEFI VFR compiler internal use.\r
 \r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2017, 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
@@ -19,7 +19,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "Common/UefiInternalFormRepresentation.h"\r
 #include "Common/MdeModuleHii.h"\r
 \r
-#define MAX_PATH                 255\r
 #define MAX_VFR_LINE_LEN         4096\r
 \r
 #define EFI_IFR_MAX_LENGTH       0xFF\r
index e65a92534f0de1eb6dc568e85e08bffb5b37c480..831f6b51747fb8c6372d5d956f9171897fc9a788 100644 (file)
@@ -119,10 +119,6 @@ CVfrCompiler::OptionInitialization (
         DebugError (NULL, 0, 1001, "Missing option", "-o missing output directory name");\r
         goto Fail;\r
       }\r
-      if (strlen (Argv[Index]) > MAX_PATH - 1) {\r
-        DebugError (NULL, 0, 1003, "Invalid option value", "Output directory name %s is too long", Argv[Index]);\r
-        goto Fail;\r
-      }\r
 \r
       mOptions.OutputDirectory = (CHAR8 *) malloc (strlen (Argv[Index]) + strlen ("\\") + 1);\r
       if (mOptions.OutputDirectory == NULL) {\r
@@ -186,10 +182,6 @@ CVfrCompiler::OptionInitialization (
     DebugError (NULL, 0, 1001, "Missing option", "VFR file name is not specified.");\r
     goto Fail;\r
   } else {\r
-    if (strlen (Argv[Index]) > MAX_PATH) {\r
-      DebugError (NULL, 0, 1003, "Invalid option value", "VFR file name %s is too long.", Argv[Index]);\r
-      goto Fail;\r
-    }\r
     mOptions.VfrFileName = (CHAR8 *) malloc (strlen (Argv[Index]) + 1);\r
     if (mOptions.VfrFileName == NULL) {\r
       DebugError (NULL, 0, 4001, "Resource: memory can't be allocated", NULL);\r
@@ -355,10 +347,6 @@ CVfrCompiler::SetBaseFileName (
   }\r
 \r
   *pExt = '\0';\r
-  if (strlen (pFileName) > MAX_PATH - 1) {\r
-    *pExt = '.';\r
-    return -1;\r
-  }\r
 \r
   mOptions.VfrBaseFileName = (CHAR8 *) malloc (strlen (pFileName) + 1);\r
   if (mOptions.VfrBaseFileName == NULL) {\r
@@ -387,9 +375,6 @@ CVfrCompiler::SetPkgOutputFileName (
            strlen (mOptions.VfrBaseFileName) +\r
            strlen (VFR_PACKAGE_FILENAME_EXTENSION) +\r
            1;\r
-  if (Length > MAX_PATH) {\r
-    return -1;\r
-  }\r
 \r
   mOptions.PkgOutputFileName = (CHAR8 *) malloc (Length);\r
   if (mOptions.PkgOutputFileName == NULL) {\r
@@ -418,9 +403,6 @@ CVfrCompiler::SetCOutputFileName (
            strlen (mOptions.VfrBaseFileName) +\r
            strlen (".c") +\r
            1;\r
-  if (Length > MAX_PATH) {\r
-    return -1;\r
-  }\r
 \r
   mOptions.COutputFileName = (CHAR8 *) malloc (Length);\r
   if (mOptions.COutputFileName == NULL) {\r
@@ -449,9 +431,6 @@ CVfrCompiler::SetPreprocessorOutputFileName (
            strlen (mOptions.VfrBaseFileName) +\r
            strlen (VFR_PREPROCESS_FILENAME_EXTENSION) +\r
            1;\r
-  if (Length > MAX_PATH) {\r
-    return -1;\r
-  }\r
 \r
   mOptions.PreprocessorOutputFileName = (CHAR8 *) malloc (Length);\r
   if (mOptions.PreprocessorOutputFileName == NULL) {\r
@@ -480,9 +459,6 @@ CVfrCompiler::SetRecordListFileName (
            strlen (mOptions.VfrBaseFileName) +\r
            strlen (VFR_RECORDLIST_FILENAME_EXTENSION) +\r
            1;\r
-  if (Length > MAX_PATH) {\r
-    return -1;\r
-  }\r
 \r
   mOptions.RecordListFile = (CHAR8 *) malloc (Length);\r
   if (mOptions.RecordListFile == NULL) {\r