aboutsummaryrefslogtreecommitdiffstats
path: root/core/elflink/load_env32.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/elflink/load_env32.c')
-rw-r--r--core/elflink/load_env32.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/elflink/load_env32.c b/core/elflink/load_env32.c
index 50ec266d..0483d865 100644
--- a/core/elflink/load_env32.c
+++ b/core/elflink/load_env32.c
@@ -186,6 +186,12 @@ out:
writestr("\nFailed to load ldlinux.c32");
}
+static const char *__cmdline;
+__export const char *com32_cmdline(void)
+{
+ return __cmdline;
+}
+
__export int create_args_and_load(char *cmdline)
{
char *p, **argv;
@@ -237,6 +243,12 @@ __export int create_args_and_load(char *cmdline)
*/
while (*p && isspace(*p))
p++;
+
+ /*
+ * Point __cmdline at "argv[1] ... argv[argc-1]"
+ */
+ if (i == 0)
+ __cmdline = p;
}
/* NUL-terminate */