shithub: mc

Download patch

ref: 61bf93a04f438f9ff1273a996b7d8030b1547259
parent: 4a0be740af3f660508516835969ee345836ca6ec
author: Ori Bernstein <[email protected]>
date: Wed Jun 5 07:13:44 EDT 2013

Remember to close the file when reading deps.

--- a/myrbuild/myrbuild.c
+++ b/myrbuild/myrbuild.c
@@ -165,7 +165,7 @@
 
     f = fopen(file, "r");
     if (!f)
-        err(1, "Could not open file %s", file);
+        err(1, "Could not open file \"%s\"", file);
 
     i = 0;
     while (fgets(buf, sizeof buf, f)) {
@@ -179,6 +179,7 @@
         else
             free(dep);
     }
+    fclose(f);
     *ndeps = i;
 }