]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/MakeDeps.java
Fixed EDKT527 by adding a check on the file size in case of zero byte of byte
[mirror_edk2.git] / Tools / Java / Source / FrameworkTasks / org / tianocore / framework / tasks / MakeDeps.java
index f1fb8243363a323faf407de2ed5ef28504fd152e..86f39adafc76b4be796d662d81a9573bbb1304cc 100644 (file)
@@ -57,7 +57,7 @@ public class MakeDeps extends Task {
     //\r
     // regular expression for "#include ..." directive\r
     // \r
-    private static final Pattern incPattern = Pattern.compile("[\n\r]+[ \t#]*[ \t]*include[ \t]+[\"<]*([^\n\r\"<>]+)[>\"]*[\n\r]+");\r
+    private static final Pattern incPattern = Pattern.compile("[\n\r \t#]*include[ \t]+[\"<]*([^\n\r\"<>]+)[>\" \t]*");\r
 \r
     public MakeDeps() {\r
 \r
@@ -295,7 +295,8 @@ public class MakeDeps extends Task {
         while (!pendingFiles.empty()) {\r
             String src = pendingFiles.pop();\r
             File srcFile = new File(src);\r
-            if (!srcFile.exists()) {\r
+                       int fileLength = (int)srcFile.length();\r
+            if (!srcFile.exists() || fileLength == 0) {\r
                 continue;\r
             }\r
             //\r
@@ -307,7 +308,6 @@ public class MakeDeps extends Task {
                 FileInputStream fileReader = null;\r
                 BufferedInputStream bufReader = null;\r
                 String fileContent = "";\r
-                int fileLength = (int)srcFile.length();\r
 \r
                 try {\r
                     fileReader = new FileInputStream(srcFile);\r