From: Robert Pengelly Date: Sat, 18 Oct 2025 03:58:48 +0000 (+0100) Subject: Possible bug fix X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=f5cec93fc4c890e256586e396a7cdf175bda6f48;p=xmake.git Possible bug fix --- 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); }