X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=builtins%2Fdeclare.def;h=3bdca64c7af522eb044555ed416691658ea39adb;hb=cce855bc5b117cb7ae70064131120687bc69fac0;hp=ae49b66bfb144a986437cea92bb69e304172b580;hpb=e8ce775db824de329b81293b4e5d8fbd65624528;p=platform%2Fupstream%2Fbash.git diff --git a/builtins/declare.def b/builtins/declare.def index ae49b66..3bdca64 100644 --- a/builtins/declare.def +++ b/builtins/declare.def @@ -57,6 +57,9 @@ $END #include #if defined (HAVE_UNISTD_H) +# ifdef _MINIX +# include +# endif # include #endif @@ -377,6 +380,18 @@ declare_internal (list, local_var) FREE (var->value); var->value = t; } + + /* If we found this variable in the temporary environment, as with + `var=value declare -x var', make sure it is treated identically + to `var=value export var'. Do the same for `declare -r' and + `readonly'. Preserve the attributes, except for att_tempvar. */ + if ((flags_on & (att_exported|att_readonly)) && tempvar_p (var)) + { + SHELL_VAR *tv; + tv = bind_variable (var->name, var->value ? var->value : ""); + tv->attributes = var->attributes & ~att_tempvar; + dispose_variable (var); + } } stupidly_hack_special_variables (name);