From 90bb66e1f1cee7d63ac0d011e06662920431c718 Mon Sep 17 00:00:00 2001 From: John Ankarstrom Date: Tue, 6 Jul 2021 22:30:38 +0200 Subject: Execute commands in the same shell process --- build.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'build.c') diff --git a/build.c b/build.c index ea17de3..6af16f0 100644 --- a/build.c +++ b/build.c @@ -155,10 +155,13 @@ uptodate: build: /* run commands */ + buf[0] = 0; for (j = 0; j < icmd; j++) { fprintf(stderr, "%s: %s\n", argv[i], cmd[j]); - system(cmd[j]); + strncat(buf, cmd[j], sizeof(buf)-1); + strncat(buf, "\n", sizeof(buf)-1); } + system(buf); done: fclose(fp); -- cgit v1.2.3