permit 'read -A/-a arr[idx]' as long as only one element is read;

fix corruption of array indicēs with this construct (LP#1533396)
This commit is contained in:
tg
2016-01-14 22:49:33 +00:00
parent 0141794c2e
commit 1b0e4f54cb
3 changed files with 28 additions and 10 deletions

6
sh.h
View File

@@ -10,7 +10,7 @@
/*-
* Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
* 2011, 2012, 2013, 2014, 2015
* 2011, 2012, 2013, 2014, 2015, 2016
* mirabilos <m@mirbsd.org>
*
* Provided that these terms and disclaimer and all copyright notices
@@ -175,7 +175,7 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.753 2016/01/13 17:20:52 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.754 2016/01/14 22:49:32 tg Exp $");
#endif
#define MKSH_VERSION "R52 2016/01/13"
@@ -1186,6 +1186,8 @@ struct tbl {
};
EXTERN struct tbl vtemp;
/* set by global() and local() */
EXTERN bool last_lookup_was_array;
/* common flag bits */
#define ALLOC BIT(0) /* val.s has been allocated */