2007-10-05 03:27:49 +03:00
|
|
|
Index: busybox-1.7.2/shell/ash.c
|
2007-06-04 14:25:53 +03:00
|
|
|
===================================================================
|
2007-10-05 03:27:49 +03: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 22:17:18 +02:00
|
|
|
const char *p;
|
|
|
|
char **aptr;
|
|
|
|
int flag = argv[0][0] == 'r'? VREADONLY : VEXPORT;
|
|
|
|
+ int mask = ~0;
|
2007-10-05 03:27:49 +03:00
|
|
|
+ int nopt;
|
2006-11-22 22:17:18 +02:00
|
|
|
|
2007-10-05 03:27:49 +03:00
|
|
|
- if (nextopt("p") != 'p') {
|
|
|
|
+ while ((nopt = nextopt("np"))) {
|
|
|
|
+ if (nopt == 'n') {
|
2006-11-22 22:17:18 +02:00
|
|
|
+ mask = ~flag;
|
|
|
|
+ } else { /* p */
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
2007-10-05 03:27:49 +03: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 22:17:18 +02:00
|
|
|
}
|
2007-10-05 03:27:49 +03:00
|
|
|
- setvar(name, p, flag);
|
|
|
|
+ setvar(name, p, flag & mask);
|
|
|
|
} while ((name = *++aptr) != NULL);
|
|
|
|
return 0;
|
|
|
|
}
|