From f5cec93fc4c890e256586e396a7cdf175bda6f48 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Sat, 18 Oct 2025 04:58:48 +0100 Subject: [PATCH] Possible bug fix --- xmake.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/xmake.c b/xmake.c index c80ce7b..028ee47 100644 --- a/xmake.c +++ b/xmake.c @@ -1258,16 +1258,23 @@ int main (int argc, char **argv) { unsigned long len; - for (i = 0; makeflags[i]; i++) { + for (i = 0; ptr[i]; i++) { - if (isspace ((int) makeflags[i])) { + if (isspace ((int) ptr[i])) { argc++; } } argv = xmalloc (sizeof (*argv) * (argc + 1)); - i = 0; + + for (i = 0; ; i++) { + + if (!isspace ((int) ptr[i])) { + break; + } + + } argv[1] = ptr + i; argc = 1; @@ -1341,6 +1348,8 @@ int main (int argc, char **argv) { argv[argc] = 0; parse_args (argv, argc); + + free (argv); } -- 2.34.1