From aed569cdba5e973a048607b0ca74042c240d4db8 Mon Sep 17 00:00:00 2001
From: midipix <writeonce@midipix.org>
Date: Sat, 10 Feb 2024 23:51:58 +0000
Subject: compile mode: filter out all -f switches when compiling in --tag=RC
 mode.

---
 src/logic/slbt_exec_compile.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/logic/slbt_exec_compile.c b/src/logic/slbt_exec_compile.c
index 522d1fe..3941bf6 100644
--- a/src/logic/slbt_exec_compile.c
+++ b/src/logic/slbt_exec_compile.c
@@ -103,7 +103,8 @@ static int slbt_exec_compile_finalize_argument_vector(
 		base++;
 	}
 
-	/* join all other args, starting with de-duplicated -I arguments */
+	/* join all other args, starting with de-duplicated -I arguments, */
+	/* and filter out all -f switches when compiling in --tag=RC mode */
 	src = aargv;
 	cap = aarg;
 	dst = &base[1];
@@ -130,7 +131,12 @@ static int slbt_exec_compile_finalize_argument_vector(
 	src = aargv;
 
 	for (; src<cap; ) {
-		if (((*src)[0] != '-') || ((*src)[1] != 'I'))
+		if ((dctx->cctx->tag == SLBT_TAG_RC)
+				&& ((*src)[0] == '-')
+				&& ((*src)[1] == 'f'))
+			(void)0;
+
+		else if (((*src)[0] != '-') || ((*src)[1] != 'I'))
 			*dst++ = *src;
 
 		src++;
-- 
cgit v1.2.3