2007-10-05 08:27:49 +08:00
|
|
|
Index: busybox-1.7.2/shell/ash.c
|
2007-06-04 19:25:53 +08:00
|
|
|
===================================================================
|
2007-10-31 04:36:25 +08:00
|
|
|
--- busybox-1.7.2.orig/shell/ash.c 2007-10-30 15:34:59.000000000 -0500
|
|
|
|
+++ busybox-1.7.2/shell/ash.c 2007-10-30 15:35:02.000000000 -0500
|
2007-10-05 08:27:49 +08:00
|
|
|
@@ -11310,8 +11310,18 @@
|
2006-11-23 04:17:18 +08:00
|
|
|
const char *p;
|
|
|
|
char **aptr;
|
|
|
|
int flag = argv[0][0] == 'r'? VREADONLY : VEXPORT;
|
|
|
|
+ int mask = ~0;
|
2007-10-05 08:27:49 +08:00
|
|
|
+ int nopt;
|
2006-11-23 04:17:18 +08:00
|
|
|
|
2007-10-05 08:27:49 +08:00
|
|
|
- if (nextopt("p") != 'p') {
|
|
|
|
+ while ((nopt = nextopt("np"))) {
|
|
|
|
+ if (nopt == 'n') {
|
2006-11-23 04:17:18 +08:00
|
|
|
+ mask = ~flag;
|
|
|
|
+ } else { /* p */
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
2007-10-05 08:27:49 +08: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-23 04:17:18 +08:00
|
|
|
}
|
2007-10-05 08:27:49 +08:00
|
|
|
- setvar(name, p, flag);
|
|
|
|
+ setvar(name, p, flag & mask);
|
|
|
|
} while ((name = *++aptr) != NULL);
|
|
|
|
return 0;
|
|
|
|
}
|