~bl4ckb0ne/boson

249d2933a8e6af5c24812100ff20096558e44450 — Simon Zeni 3 months ago b2e3d13
ninja: fix include append
1 files changed, 6 insertions(+), 2 deletions(-)

M src/ninja.c
M src/ninja.c => src/ninja.c +6 -2
@@ 119,8 119,12 @@ write_targets(FILE *file, struct context *ctx)

		char includes[PATH_MAX] = {0};
		for (size_t j = 0; j < target->include.n; ++j) {
			snprintf(includes, sizeof(includes), "%s -I%s",
					includes, target->include.paths[j]);
			int r = snprintf(includes + strlen(includes),
					sizeof(includes) - strlen(includes),
					" -I%s", target->include.paths[j]);
			if (r < 0) {
				fatal("failed to compose inclues");
			}
		}