From 2018dbab3dac93b2c22cc247660b4c084e57f99c Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 1 Sep 2023 19:00:03 -0500 Subject: [PATCH] Switch 2k global to malloc(). --- toys/posix/grep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toys/posix/grep.c b/toys/posix/grep.c index c3734ced..1c0eed78 100644 --- a/toys/posix/grep.c +++ b/toys/posix/grep.c @@ -72,7 +72,7 @@ GLOBALS( char *purple, *cyan, *red, *green, *grey; struct double_list *reg; int found, tried, delim; - struct arg_list *fixed[256]; + struct arg_list **fixed; ) struct reg { @@ -501,6 +501,8 @@ void grep_main(void) { char **ss = toys.optargs; + TT.fixed = xzalloc(256*sizeof(*TT.fixed)); + if (FLAG(color) && (!TT.color || !strcmp(TT.color, "auto")) && !isatty(1)) toys.optflags &= ~FLAG_color; -- 2.39.2