1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00
freebsd-ports/shells/bash/files/patch-arrayfunc.c
2004-08-10 19:04:41 +00:00

17 lines
425 B
C

#
# Fix segfault when accessing an unset array
#
# http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00026.html
#
--- arrayfunc.c.orig Fri Dec 19 00:03:09 2003
+++ arrayfunc.c Sun Aug 1 20:43:00 2004
@@ -611,7 +611,7 @@
var = find_variable (t);
free (t);
- return var;
+ return (var == 0 || invisible_p (var)) ? (SHELL_VAR *)0 : var;
}
/* Return a string containing the elements in the array and subscript