Imported from ../bash-2.04.tar.gz.

This commit is contained in:
Jari Aalto 2000-03-17 21:46:59 +00:00
commit bb70624e96
387 changed files with 28522 additions and 9334 deletions

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES declare.c
@ -255,10 +255,15 @@ declare_internal (list, local_var)
{
#if defined (ARRAY_VARS)
if ((flags_on & att_array) || making_array_special)
make_local_array_variable (name);
var = make_local_array_variable (name);
else
#endif
make_local_variable (name);
var = make_local_variable (name);
if (var == 0)
{
any_failed++;
NEXT_VARIABLE ();
}
}
/* If we are declaring a function, then complain about it in some way.
@ -297,8 +302,8 @@ declare_internal (list, local_var)
}
else /* declare -[fF] -[rx] name [name...] */
{
var->attributes |= flags_on;
var->attributes &= ~flags_off;
VSETATTR (var, flags_on);
VUNSETATTR (var, flags_off);
}
}
else
@ -364,22 +369,18 @@ declare_internal (list, local_var)
var = convert_var_to_array (var);
#endif /* ARRAY_VARS */
var->attributes |= flags_on;
var->attributes &= ~flags_off;
VSETATTR (var, flags_on);
VUNSETATTR (var, flags_off);
#if defined (ARRAY_VARS)
if (offset && assigning_array_special)
assign_array_var_from_string (var, value);
else
#endif
/* This essentially duplicates the internals of bind_variable() */
/* bind_variable_value duplicates the essential internals of
bind_variable() */
if (offset)
{
var->attributes &= ~att_invisible;
t = make_variable_value (var, value);
FREE (var->value);
var->value = t;
}
bind_variable_value (var, value);
/* If we found this variable in the temporary environment, as with
`var=value declare -x var', make sure it is treated identically