summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-13 00:37:32 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-13 00:37:32 +0000
commitee53575f836f97ffc007241dff0ea6a64c6c2aeb (patch)
tree4e3a5210d564d5cdf17f5839a00a0a0368de3ce5 /src/utils
parent7d67cf922c506ad1ba443e96ffcc46810f90478c (diff)
Added new section: 14. Build Directives.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/utils.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/utils/utils.c b/src/utils/utils.c
index 4af811f..5f41f44 100644
--- a/src/utils/utils.c
+++ b/src/utils/utils.c
@@ -537,24 +537,30 @@ void scan_build_directives(ParserContext *ctx, const char *src)
if (0 == strncmp(line, "link:", 5))
{
+ char *val = line + 5;
+ while (*val == ' ') val++;
if (strlen(g_link_flags) > 0)
{
strcat(g_link_flags, " ");
}
- strcat(g_link_flags, line + 5);
+ strcat(g_link_flags, val);
}
else if (0 == strncmp(line, "cflags:", 7))
{
+ char *val = line + 7;
+ while (*val == ' ') val++;
if (strlen(g_cflags) > 0)
{
strcat(g_cflags, " ");
}
- strcat(g_cflags, line + 7);
+ strcat(g_cflags, val);
}
else if (0 == strncmp(line, "include:", 8))
{
+ char *val = line + 8;
+ while (*val == ' ') val++;
char flags[2048];
- sprintf(flags, "-I%s", line + 8);
+ sprintf(flags, "-I%s", val);
if (strlen(g_cflags) > 0)
{
strcat(g_cflags, " ");
@@ -563,8 +569,10 @@ void scan_build_directives(ParserContext *ctx, const char *src)
}
else if (strncmp(line, "lib:", 4) == 0)
{
+ char *val = line + 4;
+ while (*val == ' ') val++;
char flags[2048];
- sprintf(flags, "-L%s", line + 4);
+ sprintf(flags, "-L%s", val);
if (strlen(g_link_flags) > 0)
{
strcat(g_link_flags, " ");
@@ -573,8 +581,10 @@ void scan_build_directives(ParserContext *ctx, const char *src)
}
else if (strncmp(line, "define:", 7) == 0)
{
+ char *val = line + 7;
+ while (*val == ' ') val++;
char flags[2048];
- sprintf(flags, "-D%s", line + 7);
+ sprintf(flags, "-D%s", val);
if (strlen(g_cflags) > 0)
{
strcat(g_cflags, " ");