Skip to content

Commit 6693130

Browse files
committed
Fix depfiles only outputting half of the dependencies
Jesus christ what is this slip up even lmao
1 parent 69c2257 commit 6693130

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

patch/depfile_build.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,6 @@ __cdecl void depfile_build(char *header_struct, char *depfile_struct, mwstring *
305305

306306
// Print all header dependencies
307307
for (int cur_header = 0; cur_header < num_headers; cur_header++) {
308-
num_headers--;
309-
310308
mwpath header;
311309
char header_full[PATH_MAX];
312310

@@ -341,7 +339,8 @@ __cdecl void depfile_build(char *header_struct, char *depfile_struct, mwstring *
341339
char *header_escaped = depfile_escape_spaces(
342340
strchr(header_full, ' ') != NULL, escape_buf, header_full);
343341

344-
sprintf(strbuf, "\t%s %s\n", header_escaped, num_headers ? "\\" : "");
342+
sprintf(strbuf, "\t%s %s\n", header_escaped,
343+
(cur_header < num_headers - 1) ? "\\" : "");
345344
if (string_append(string, strbuf, strlen(strbuf))) goto outofmem;
346345
}
347346
return;

test/deps.d

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,19 @@ deps.o: deps.c \
1515
inc/deps14.h \
1616
inc/deps15.h \
1717
inc/deps16.h \
18+
inc/deps17.h \
19+
inc/deps18.h \
20+
inc/deps19.h \
21+
inc/deps20.h \
22+
inc/deps21.h \
23+
inc/deps22.h \
24+
inc/deps23.h \
25+
inc/deps24.h \
26+
inc/deps25.h \
27+
inc/deps26.h \
28+
inc/deps27.h \
29+
inc/deps28.h \
30+
inc/deps29.h \
31+
inc/deps30.h \
32+
inc/deps31.h \
33+
inc/deps32.h

0 commit comments

Comments
 (0)