2007-10-05 00:27:49 +00:00
|
|
|
Index: busybox-1.7.2/shell/ash.c
|
2007-06-04 11:25:53 +00:00
|
|
|
===================================================================
|
2007-10-05 00:27:49 +00:00
|
|
|
--- busybox-1.7.2.orig/shell/ash.c 2007-09-03 13:48:38.000000000 +0200
|
|
|
|
+++ busybox-1.7.2/shell/ash.c 2007-10-04 14:47:41.607489342 +0200
|
|
|
|
@@ -11310,8 +11310,18 @@
|
2006-11-22 20:17:18 +00:00
|
|
|
const char *p;
|
|
|
|
char **aptr;
|
|
|
|
int flag = argv[0][0] == 'r'? VREADONLY : VEXPORT;
|
|
|
|
+ int mask = ~0;
|
2007-10-05 00:27:49 +00:00
|
|
|
+ int nopt;
|
2006-11-22 20:17:18 +00:00
|
|
|
|
2007-10-05 00:27:49 +00:00
|
|
|
- if (nextopt("p") != 'p') {
|
|
|
|
+ while ((nopt = nextopt("np"))) {
|
|
|
|
+ if (nopt == 'n') {
|
2006-11-22 20:17:18 +00:00
|
|
|
+ mask = ~flag;
|
|
|
|
+ } else { /* p */
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
2007-10-05 00:27:49 +00:00
|
|
|
+ if (nopt != 'p') {
|
|
|
|
aptr = argptr;
|
|
|
|
name = *aptr;
|
|
|
|
if (name) {
|
|
|
|
@@ -11323,10 +11333,11 @@
|
|
|
|
vp = *findvar(hashvar(name), name);
|
|
|
|
if (vp) {
|
|
|
|
vp->flags |= flag;
|
|
|
|
+ vp->flags &= mask;
|
|
|
|
continue;
|
|
|
|
}
|
2006-11-22 20:17:18 +00:00
|
|
|
}
|
2007-10-05 00:27:49 +00:00
|
|
|
- setvar(name, p, flag);
|
|
|
|
+ setvar(name, p, flag & mask);
|
|
|
|
} while ((name = *++aptr) != NULL);
|
|
|
|
return 0;
|
|
|
|
}
|