scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 22fbd88f278c96cd6ebe2244a17eef5b57914d1e
parent 53781df7eb27fc4b198b630afb1e3cefb00cd1e8
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 29 Oct 2024 20:32:10 +0100

make: Detect assignements in MAKEFLAGS

The format used in MAKEFLAGS can follow 2 different formats. In the first
case it accepts flags without the leading - and without spaces, and in the
second case it accepts flags with leading - and with spaces. Only in the
second case assignements are supported.

Diffstat:
Msrc/cmd/scc-make/main.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/cmd/scc-make/main.c b/src/cmd/scc-make/main.c @@ -258,7 +258,7 @@ parsemakeflags(void) while (*flags == ' ' || *flags == '\t') flags++; - if (flags[0] != '-') { + if (flags[0] != '-' && !strchr(flags, '=')) { while (*flags) { parseflag(*flags, &flags, NULL); flags++; @@ -273,7 +273,8 @@ parsemakeflags(void) arr[n] = NULL; } - parseargv(arr, NULL, NOEXPORT); + if (arr) + parseargv(arr, NULL, NOEXPORT); free(arr); } }