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 7dfb8cbb064938d3452a5165647a5b78d19dcd8b..86f39adafc76b4be796d662d81a9573bbb1304cc 100644 (file)
@@ -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