[package] busybox: update to v1.16.1 (based on v1.16.0 update patch from Peter Wagner)
[openwrt.git] / package / busybox / patches / 250-ash_export-n.patch
1 --- a/shell/ash.c
2 +++ b/shell/ash.c
3 @@ -12340,8 +12340,17 @@ exportcmd(int argc UNUSED_PARAM, char **
4 const char *p;
5 char **aptr;
6 int flag = argv[0][0] == 'r' ? VREADONLY : VEXPORT;
7 + int mask = ~0;
8 + int nopt;
9 + while ((nopt = nextopt("np"))) {
10 + if (nopt == 'n') {
11 + mask = ~flag;
12 + } else { /* p */
13 + break;
14 + }
15 + }
16
17 - if (nextopt("p") != 'p') {
18 + if (nopt != 'p') {
19 aptr = argptr;
20 name = *aptr;
21 if (name) {
22 @@ -12353,10 +12362,12 @@ exportcmd(int argc UNUSED_PARAM, char **
23 vp = *findvar(hashvar(name), name);
24 if (vp) {
25 vp->flags |= flag;
26 + vp->flags &= mask;
27 continue;
28 }
29 }
30 setvar(name, p, flag);
31 + setvar(name, p, flag & mask);
32 } while ((name = *++aptr) != NULL);
33 return 0;
34 }
This page took 0.048312 seconds and 5 git commands to generate.