aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-01-11 22:26:40 +1000
committerGravatar axel <axel@liljencrantz.se>2006-01-11 22:26:40 +1000
commit032a736840f95044c3446567d890ce935564c0cc (patch)
tree8660835ed42cd3b870aa237b97f29ad1d25553df /builtin.c
parentd9663a4ec4e032917127b154ee6130c9cbf93312 (diff)
Make the read builtin able to create universal variables
darcs-hash:20060111122640-ac50b-4b411b9822a44ae105b71ca51ee47d0aa13a1a62.gz
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/builtin.c b/builtin.c
index 7ffafe05..fbb4400f 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1437,6 +1437,10 @@ static int builtin_read( wchar_t **argv )
}
,
{
+ L"universal", no_argument, 0, 'U'
+ }
+ ,
+ {
L"unexport", no_argument, 0, 'u'
}
,
@@ -1458,7 +1462,7 @@ static int builtin_read( wchar_t **argv )
int opt = wgetopt_long( argc,
argv,
- L"xglup:c:",
+ L"xglUup:c:",
long_options,
&opt_index );
if( opt == -1 )
@@ -1486,6 +1490,9 @@ static int builtin_read( wchar_t **argv )
case L'l':
place |= ENV_LOCAL;
break;
+ case L'U':
+ place |= ENV_UNIVERSAL;
+ break;
case L'u':
place |= ENV_UNEXPORT;
break;
@@ -1517,7 +1524,7 @@ static int builtin_read( wchar_t **argv )
return 1;
}
- if( (place&ENV_LOCAL) && (place & ENV_GLOBAL) )
+ if( (place&ENV_LOCAL?1:0) + (place & ENV_GLOBAL?1:0) + (place & ENV_UNIVERSAL?1:0) > 1)
{
sb_printf( sb_err,
BUILTIN_ERR_GLOCAL,