From 3af6da6a66f8a0b26b69f167c2370ec7638a5ebf Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Mon, 6 Mar 2023 16:47:47 +0100 Subject: [PATCH] :fire: more on embed --- scripts/embed.bash | 4 ++++ src/arg.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/embed.bash b/scripts/embed.bash index 907f52ef..6d5f1122 100644 --- a/scripts/embed.bash +++ b/scripts/embed.bash @@ -191,10 +191,14 @@ ANN const char** config_args(int *argc, char **const argv) { for(int i = 0; i < config_argc; i++) { args[i] = config_argv[i]; } +#ifndef GWION_STANDALONE for(int i = 0; i < *argc; i++) { args[i + config_argc] = argv[i]; } *argc = nargs; +#else + *argc = config_argc; +#endif return args; } EOF diff --git a/src/arg.c b/src/arg.c index bd92ddea..d090e700 100644 --- a/src/arg.c +++ b/src/arg.c @@ -46,7 +46,7 @@ ANN static inline void config_end(const Vector config) { } } -//#ifndef GWION_CONFIG_ARGS +#ifndef GWION_STANDALONE ANN static m_str plug_dir(void) { const m_str home = getenv("HOME"); const size_t sz = strlen(home); @@ -56,7 +56,7 @@ ANN static m_str plug_dir(void) { strcpy(plug_dir + sz, pdir); return plug_dir; } -//#endif +#endif enum arg_type { ARG_FILE, @@ -377,14 +377,14 @@ ANN m_bool _arg_parse(struct ArgInternal *arg) { return GW_OK; } -//#ifndef GWION_CONFIG_ARGS +#ifndef GWION_STANDALONE ANN static void config_default(struct ArgInternal *arg) { char *home = getenv("HOME"); char c[strlen(home) + strlen(GWIONRC) + 2]; sprintf(c, "%s/%s", home, GWIONRC); config_parse(arg, c); } -//#endif +#endif ANN m_bool arg_parse(const Gwion gwion, CliArg *a) { struct ArgInternal arg = {.gwion = gwion, .arg = a}; -- 2.43.0