Skip to content

Commit

Permalink
Stop holding on to the .dep file handle
Browse files Browse the repository at this point in the history
  • Loading branch information
atilaneves committed Mar 28, 2024
1 parent 5e74a1e commit 4213f2d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions payload/reggae/backend/binary.d
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,14 @@ private:

//Checks dependencies listed in the .dep file created by the compiler
bool checkDeps(Target target, in string depFileName) @trusted {
import std.array: array;

// byLine splits at `\n`, so open Windows text files with CRLF line terminators in non-binary mode
auto file = File(depFileName, "r");
auto lines = file.byLine.map!(a => a.to!string);
auto lines = File(depFileName, "r")
.byLine
.map!(a => a.to!string)
.array
;
auto dependencies = dependenciesFromFile(lines);

if(anyNewer(options.projectPath, dependencies, target)) {
Expand Down

0 comments on commit 4213f2d

Please sign in to comment.