environment is scanned
[bash-3.2-beta frozen]
+
+ 9/5
+ ---
+variables.c
+ - change dispose_used_env_vars to call maybe_make_export_env
+ immediately if we're disposing a temporary environment, since
+ `environ' points to the export environment and getenv() will use
+ that on systems that don't allow getenv() to be replaced. This
+ could cause the temporary environment to affect the shell. Bug
+ reported by Vasco Pedro <vp@di.uevora.pt>
+
+builtins/echo.def,doc/{bash.1,bashref.texi}
+ - clarify that `echo -e' and echo when the `xpg_echo' shell option is
+ enabled require the \0 to precede any octal constant to be expanded.
+ Reported by Vasco Pedro <vp@di.uevora.pt>
Makefile.in
- switch the TAGS and tags targets so TAGS is the output of `etags' and
tags is the output of `ctags'. Suggested by Masatake YAMATO
+
+ 8/25
+ ----
+execute_cmd.c
+ - change code to match documentation: set BASH_COMMAND (which takes its
+ value from the_printed_command_except_trap) only when not running a
+ trap. Rocky says the debugger is ok with this, and this is what his
+ original diffs did
+
+ 8/29
+ ----
+variables.c
+ - change set_if_not to create shell_variables if it is NULL, since
+ -o invocation options can cause variables to be set before the
+ environment is scanned
+
+[bash-3.2-beta frozen]
+
+ 9/5
+ ---
+variables.c
+ - change dispose_used_env_vars to call maybe_make_export_env
+ immediately if we're disposing a temporary environment, since
+ `environ' points to the export environment and getenv() will use
+ that on systems that don't allow getenv() to be replaced. This
+ could cause the temporary environment to affect the shell. Bug
+ reported by Vasco Pedro <vp@di.uevora.pt>
fi
if test -z "${DEBUGGER_START_FILE}"; then
- DEBUGGER_START_FILE=${ac_default_prefix}/lib/bashdb/bashdb-main.inc
+ DEBUGGER_START_FILE=${datadir}/bashdb/bashdb-main.inc
fi
opt_minimal_config=no
{
'm4_pattern_forbid' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
+ 'AC_TYPE_OFF_T' => 1,
'AC_C_VOLATILE' => 1,
+ 'AC_FUNC_CLOSEDIR_VOID' => 1,
+ 'AC_REPLACE_FNMATCH' => 1,
+ 'AC_PROG_LIBTOOL' => 1,
+ 'AC_FUNC_STAT' => 1,
+ 'AC_FUNC_WAIT3' => 1,
+ 'AC_HEADER_TIME' => 1,
+ 'AM_AUTOMAKE_VERSION' => 1,
+ 'AC_STRUCT_TM' => 1,
+ 'AC_FUNC_LSTAT' => 1,
+ 'AC_FUNC_GETMNTENT' => 1,
+ 'AC_TYPE_MODE_T' => 1,
+ 'AC_FUNC_STRTOD' => 1,
+ 'AC_CHECK_HEADERS' => 1,
+ 'AC_FUNC_STRNLEN' => 1,
+ 'm4_sinclude' => 1,
+ 'AC_PROG_CXX' => 1,
+ 'AC_PATH_X' => 1,
+ 'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
+ 'AC_PROG_AWK' => 1,
+ '_m4_warn' => 1,
+ 'AC_HEADER_STDC' => 1,
+ 'AC_HEADER_MAJOR' => 1,
+ 'AC_FUNC_ERROR_AT_LINE' => 1,
+ 'AC_PROG_GCC_TRADITIONAL' => 1,
+ 'AC_LIBSOURCE' => 1,
+ 'AC_FUNC_MBRTOWC' => 1,
+ 'AC_STRUCT_ST_BLOCKS' => 1,
+ 'AC_TYPE_SIGNAL' => 1,
+ 'AC_TYPE_UID_T' => 1,
+ 'AC_PROG_MAKE_SET' => 1,
+ 'AC_CONFIG_AUX_DIR' => 1,
+ 'm4_pattern_allow' => 1,
+ 'sinclude' => 1,
+ 'AC_DEFINE_TRACE_LITERAL' => 1,
+ 'AC_FUNC_STRERROR_R' => 1,
+ 'AC_PROG_CC' => 1,
+ 'AC_DECL_SYS_SIGLIST' => 1,
+ 'AC_FUNC_FORK' => 1,
+ 'AC_FUNC_STRCOLL' => 1,
+ 'AC_FUNC_VPRINTF' => 1,
+ 'AC_PROG_YACC' => 1,
+ 'AC_INIT' => 1,
+ 'AC_STRUCT_TIMEZONE' => 1,
+ 'AC_FUNC_CHOWN' => 1,
+ 'AC_SUBST' => 1,
+ 'AC_FUNC_ALLOCA' => 1,
+ 'AC_FUNC_GETPGRP' => 1,
+ 'AC_CANONICAL_HOST' => 1,
+ 'AC_PROG_RANLIB' => 1,
+ 'AM_INIT_AUTOMAKE' => 1,
+ 'AC_FUNC_SETPGRP' => 1,
+ 'AC_CONFIG_SUBDIRS' => 1,
+ 'AC_FUNC_MMAP' => 1,
+ 'AC_FUNC_REALLOC' => 1,
+ 'AC_TYPE_SIZE_T' => 1,
+ 'AC_CHECK_TYPES' => 1,
+ 'AC_CONFIG_LINKS' => 1,
+ 'AC_CHECK_MEMBERS' => 1,
+ 'AM_MAINTAINER_MODE' => 1,
+ 'AC_FUNC_UTIME_NULL' => 1,
+ 'AC_FUNC_SELECT_ARGTYPES' => 1,
+ 'AC_HEADER_STAT' => 1,
+ 'AC_FUNC_STRFTIME' => 1,
+ 'AC_C_INLINE' => 1,
+ 'AC_PROG_CPP' => 1,
+ 'AC_C_CONST' => 1,
+ 'AC_PROG_LEX' => 1,
+ 'AC_TYPE_PID_T' => 1,
+ 'AC_CONFIG_FILES' => 1,
+ 'include' => 1,
+ 'AC_FUNC_SETVBUF_REVERSED' => 1,
+ 'AC_PROG_INSTALL' => 1,
+ 'AM_GNU_GETTEXT' => 1,
+ 'AC_FUNC_OBSTACK' => 1,
+ 'AC_CHECK_LIB' => 1,
+ 'AC_FUNC_MALLOC' => 1,
+ 'AC_FUNC_GETGROUPS' => 1,
+ 'AC_FUNC_GETLOADAVG' => 1,
+ 'AH_OUTPUT' => 1,
+ 'AC_FUNC_FSEEKO' => 1,
+ 'AM_PROG_CC_C_O' => 1,
+ 'AM_CONDITIONAL' => 1,
+ 'AC_CANONICAL_SYSTEM' => 1,
+ 'AC_FUNC_MKTIME' => 1,
+ 'AC_CONFIG_HEADERS' => 1,
+ 'AC_HEADER_SYS_WAIT' => 1,
+ 'AC_PROG_LN_S' => 1,
+ 'AC_FUNC_MEMCMP' => 1,
+ 'm4_include' => 1,
+ 'AC_HEADER_DIRENT' => 1,
+ 'AC_CHECK_FUNCS' => 1
+ }
+ ], 'Autom4te::Request' ),
+ bless( [
+ '1',
+ 1,
+ [
+ '/usr/share/autoconf'
+ ],
+ [
+ '/usr/share/autoconf/autoconf/autoconf.m4f',
+ 'aclocal.m4',
+ 'configure.in'
+ ],
+ {
+ 'm4_pattern_forbid' => 1,
+ 'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_TYPE_OFF_T' => 1,
+ 'AC_C_VOLATILE' => 1,
'AC_FUNC_CLOSEDIR_VOID' => 1,
'AC_REPLACE_FNMATCH' => 1,
'AC_PROG_LIBTOOL' => 1,
'AC_FUNC_STAT' => 1,
'AC_HEADER_TIME' => 1,
'AC_FUNC_WAIT3' => 1,
- 'AC_FUNC_LSTAT' => 1,
- 'AC_STRUCT_TM' => 1,
'AM_AUTOMAKE_VERSION' => 1,
+ 'AC_STRUCT_TM' => 1,
+ 'AC_FUNC_LSTAT' => 1,
'AC_TYPE_MODE_T' => 1,
'AC_FUNC_GETMNTENT' => 1,
'AC_FUNC_STRTOD' => 1,
'AC_FUNC_CHOWN' => 1,
'AC_SUBST' => 1,
'AC_FUNC_ALLOCA' => 1,
- 'AC_FUNC_GETPGRP' => 1,
'AC_CANONICAL_HOST' => 1,
+ 'AC_FUNC_GETPGRP' => 1,
'AC_PROG_RANLIB' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_FUNC_SETPGRP' => 1,
'AC_FUNC_MMAP' => 1,
'AC_FUNC_REALLOC' => 1,
'AC_TYPE_SIZE_T' => 1,
- 'AC_CHECK_TYPES' => 1,
'AC_CONFIG_LINKS' => 1,
+ 'AC_CHECK_TYPES' => 1,
'AC_CHECK_MEMBERS' => 1,
'AM_MAINTAINER_MODE' => 1,
'AC_FUNC_UTIME_NULL' => 1,
'AC_FUNC_SELECT_ARGTYPES' => 1,
'AC_FUNC_STRFTIME' => 1,
'AC_HEADER_STAT' => 1,
- 'AC_PROG_CPP' => 1,
'AC_C_INLINE' => 1,
+ 'AC_PROG_CPP' => 1,
'AC_TYPE_PID_T' => 1,
- 'AC_PROG_LEX' => 1,
'AC_C_CONST' => 1,
+ 'AC_PROG_LEX' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'AC_FUNC_SETVBUF_REVERSED' => 1,
'AC_PROG_INSTALL' => 1,
'AM_GNU_GETTEXT' => 1,
- 'AC_CHECK_LIB' => 1,
'AC_FUNC_OBSTACK' => 1,
+ 'AC_CHECK_LIB' => 1,
'AC_FUNC_MALLOC' => 1,
'AC_FUNC_GETGROUPS' => 1,
'AC_FUNC_GETLOADAVG' => 1,
'AH_OUTPUT' => 1,
'AC_FUNC_FSEEKO' => 1,
'AM_PROG_CC_C_O' => 1,
- 'AC_FUNC_MKTIME' => 1,
- 'AC_CANONICAL_SYSTEM' => 1,
'AM_CONDITIONAL' => 1,
+ 'AC_CANONICAL_SYSTEM' => 1,
+ 'AC_FUNC_MKTIME' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_HEADER_SYS_WAIT' => 1,
'AC_FUNC_MEMCMP' => 1,
static char **array_concat ();
#endif
+#if 0
+static void
+dump_result (a)
+ char **a;
+{
+ int i;
+
+ for (i = 0; a[i]; i++)
+ printf ("dump_result: a[%d] = -%s-\n", i, a[i]);
+}
+#endif
+
/* Return an array of strings; the brace expansion of TEXT. */
char **
brace_expand (text)
static int brace_gobbler __P((char *, size_t, int *, int));
static char **expand_amble __P((char *, size_t, int));
static char **expand_seqterm __P((char *, size_t));
-static char **mkseq __P((int, int, int));
+static char **mkseq __P((int, int, int, int));
static char **array_concat __P((char **, char **));
#else
static int brace_gobbler ();
static char **array_concat ();
#endif
+static void
+dump_result (a)
+ char **a;
+{
+ int i;
+
+ for (i = 0; a[i]; i++)
+ printf ("dump_result: a[%d] = -%s-\n", i, a[i]);
+}
+
/* Return an array of strings; the brace expansion of TEXT. */
char **
brace_expand (text)
/* Find the text of the preamble. */
tlen = strlen (text);
i = 0;
-#if 1
+#if defined (CSH_BRACE_COMPAT)
c = brace_gobbler (text, tlen, &i, '{'); /* } */
#else
/* Make sure that when we exit this loop, c == 0 or text[i] begins a
break;
}
while (c);
-#endif
-
+#endif /* !CSH_BRACE_COMPAT */
preamble = (char *)xmalloc (i + 1);
strncpy (preamble, text, i);
result = array_concat (result, tack);
strvec_dispose (tack);
+dump_result (result);
+
return (result);
}
#define ST_CHAR 2
static char **
-mkseq (start, end, type)
- int start, end, type;
+mkseq (start, end, incr, type)
+ int start, end, incr, type;
{
- int n, incr, i;
+ int n, i;
char **result, *t;
n = abs (end - start) + 1;
result = strvec_create (n + 1);
- incr = (start < end) ? 1 : -1;
+ if (incr == 0)
+ incr = 1;
+
+ if (start > end && incr > 0)
+ incr = -incr;
+ else if (start < end && incr < 0)
+ incr = -incr;
/* Make sure we go through the loop at least once, so {3..3} prints `3' */
i = 0;
n = start;
do
{
+#if defined (SHELL)
+ QUIT; /* XXX - memory leak here */
+#endif
if (type == ST_INT)
result[i++] = itos (n);
else
rhs_v = tr;
}
- result = mkseq (lhs_v, rhs_v, lhs_t);
+ result = mkseq (lhs_v, rhs_v, 1, lhs_t);
free (lhs);
free (rhs);
DECLARE_MBSTATE;
level = quoted = pass_next = 0;
-#if 1
+#if defined (CSH_BRACE_COMPAT)
commas = 1;
#else
commas = (satisfy == '}') ? 0 : 1;
level++;
else if (c == '}' && level)
level--;
-#if 0
+#if !defined (CSH_BRACE_COMPAT)
else if (satisfy == '}' && c == brace_arg_separator && level == 0)
commas++;
else if (satisfy == '}' && STREQN (text+i, BRACE_SEQ_SPECIFIER, 2) &&
\t horizontal tab
\v vertical tab
\\ backslash
- \num the character whose ASCII code is NUM (octal).
+ \0nnn the character whose ASCII code is NNN (octal). NNN can be
+ 0 to 3 octal digits
You can explicitly turn off the interpretation of the above characters
with the -E option.
#include <stdio.h>
#include "../shell.h"
+#include "common.h"
+
$BUILTIN echo
$FUNCTION echo_builtin
$DEPENDS_ON V9_ECHO
fi
if test -z "${DEBUGGER_START_FILE}"; then
- DEBUGGER_START_FILE=${ac_default_prefix}/lib/bashdb/bashdb-main.inc
+ DEBUGGER_START_FILE=${datadir}/bashdb/bashdb-main.inc
fi
opt_minimal_config=no
fi
if test -z "${DEBUGGER_START_FILE}"; then
- DEBUGGER_START_FILE=${ac_default_prefix}/lib/bashdb/bashdb-main.inc
+ DEBUGGER_START_FILE=${datadir}/bashdb/bashdb-main.inc
fi
dnl optional shell features in config.h.in
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-AC_REVISION([for Bash 3.2, version 3.188])dnl
+AC_REVISION([for Bash 3.2, version 3.190])dnl
define(bashvers, 3.2)
-define(relstatus, devel)
+define(relstatus, beta)
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
dnl build machine.
dnl Set SIGNAMES_H based on whether or not we're cross-compiling.
+CROSS_COMPILE=
if test "x$cross_compiling" = "xyes"; then
case "${host}" in
*-cygwin*)
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
-.\" Last Change: Thu May 11 14:25:48 EDT 2006
+.\" Last Change: Fri Sep 8 13:43:16 EDT 2006
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
-.TH BASH 1 "2006 May 11" "GNU Bash-3.2"
+.TH BASH 1 "2006 September 8" "GNU Bash-3.2"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
the eight-bit character whose value is the octal value \fInnn\fP
(zero to three octal digits)
.TP
-.B \e\fInnn\fP
-the eight-bit character whose value is the octal value \fInnn\fP
-(one to three octal digits)
-.TP
.B \ex\fIHH\fP
the eight-bit character whose value is the hexadecimal value \fIHH\fP
(one or two hex digits)
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
-.\" Last Change: Thu Jan 26 09:04:43 EST 2006
+.\" Last Change: Thu May 11 14:25:48 EDT 2006
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
-.TH BASH 1 "2006 Jan 26" "GNU Bash-3.2"
+.TH BASH 1 "2006 May 11" "GNU Bash-3.2"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
.B Pathname Expansion
below).
The \fIword\fP is expanded using tilde
-expansion, parameter and variable expansion, arithmetic substituion,
+expansion, parameter and variable expansion, arithmetic substitution,
command substitution, process substitution and quote removal.
Each \fIpattern\fP examined is expanded using tilde
-expansion, parameter and variable expansion, arithmetic substituion,
+expansion, parameter and variable expansion, arithmetic substitution,
command substitution, and process substitution.
If the shell option
.B nocasematch
.B HISTFILESIZE
The maximum number of lines contained in the history file. When this
variable is assigned a value, the history file is truncated, if
-necessary, to contain no more than that number of lines. The default
+necessary, by removing the oldest entries,
+to contain no more than that number of lines. The default
value is 500. The history file is also truncated to this size after
writing it when an interactive shell exits.
.TP
is executed each time a shell function or a script executed with the
\fB.\fP or \fBsource\fP builtins finishes executing.
Signals ignored upon entry to the shell cannot be trapped or reset.
-Trapped signals are reset to their original values in a child
-process when it is created.
+Trapped signals that are not being ignored are reset to their original
+values in a child process when it is created.
The return status is false if any
.I sigspec
is invalid; otherwise
The maximum scheduling priority ("nice")
.TP
.B \-f
-The maximum size of files created by the shell
+The maximum size of files written by the shell and its children
.TP
.B \-i
The maximum number of pending signals
@item \0@var{nnn}
the eight-bit character whose value is the octal value @var{nnn}
(zero to three octal digits)
-@item \@var{nnn}
-the eight-bit character whose value is the octal value @var{nnn}
-(one to three octal digits)
@item \x@var{HH}
the eight-bit character whose value is the hexadecimal value @var{HH}
(one or two hex digits)
@code{source} builtins finishes executing.
Signals ignored upon entry to the shell cannot be trapped or reset.
-Trapped signals are reset to their original values in a child
-process when it is created.
+Trapped signals that are not being ignored are reset to their original
+values in a child process when it is created.
The return status is zero unless a @var{sigspec} does not specify a
valid signal.
The maximum scheduling priority ("nice").
@item -f
-The maximum size of files created by the shell.
+The maximum size of files written by the shell and its children.
@item -i
The maximum number of pending signals.
@item HISTFILESIZE
The maximum number of lines contained in the history file. When this
variable is assigned a value, the history file is truncated, if
-necessary, to contain no more than that number of lines.
+necessary, by removing the oldest entries,
+to contain no more than that number of lines.
The history file is also truncated to this size after
writing it when an interactive shell exits.
The default value is 500.
Copyright (C) 1988-2006 Free Software Foundation, Inc.
@end ignore
-@set LASTCHANGE Thu May 11 14:25:33 EDT 2006
+@set LASTCHANGE Fri Sep 8 13:45:21 EDT 2006
@set EDITION 3.2
@set VERSION 3.2
-@set UPDATED 11 May 2006
-@set UPDATED-MONTH May 2006
+@set UPDATED 8 September 2006
+@set UPDATED-MONTH September 2006
@ignore
-Copyright (C) 1988-2005 Free Software Foundation, Inc.
+Copyright (C) 1988-2006 Free Software Foundation, Inc.
@end ignore
-@set LASTCHANGE Fri Dec 30 10:50:51 EST 2005
+@set LASTCHANGE Thu May 11 14:25:33 EDT 2006
-@set EDITION 3.1
-@set VERSION 3.1
-@set UPDATED 30 December 2005
-@set UPDATED-MONTH December 2005
+@set EDITION 3.2
+@set VERSION 3.2
+@set UPDATED 11 May 2006
+@set UPDATED-MONTH May 2006
-BUILD_DIR=/usr/local/build/chet/bash/bash-current
+BUILD_DIR=/usr/local/build/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
return $status
}
before: try to assign to FUNCNAME
-outside: FUNCNAME =
+outside: FUNCNAME = main
before: FUNCNAME = func
FUNCNAME = func2
after: FUNCNAME = func
}
echo before: try to assign to FUNCNAME
-FUCNAME=7
+FUNCNAME=7
echo outside: FUNCNAME = $FUNCNAME
func
myfunction
myfunction | cat
+segv()
+{
+ echo foo | return 5
+}
+
+segv
+echo $?
+
exit 0
dispose_used_env_vars ()
{
if (temporary_env)
- dispose_temporary_env (propagate_temp_var);
+ {
+ dispose_temporary_env (propagate_temp_var);
+ maybe_make_export_env ();
+ }
}
/* Take all of the shell variables in the temporary environment HASH_TABLE
int shell_level = 0;
/* Some forward declarations. */
+static void create_variable_tables __P((void));
+
static void set_machine_vars __P((void));
static void set_home_var __P((void));
static void set_shell_var __P((void));
static void push_exported_var __P((PTR_T));
static inline int find_special_var __P((const char *));
-
-/* Initialize the shell variables from the current environment.
- If PRIVMODE is nonzero, don't import functions from ENV or
- parse $SHELLOPTS. */
-void
-initialize_shell_variables (env, privmode)
- char **env;
- int privmode;
-{
- char *name, *string, *temp_string;
- int c, char_index, string_index, string_length;
- SHELL_VAR *temp_var;
+static void
+create_variable_tables ()
+{
if (shell_variables == 0)
{
shell_variables = global_variables = new_var_context ((char *)NULL, 0);
if (shell_function_defs == 0)
shell_function_defs = hash_create (0);
#endif
+}
+
+/* Initialize the shell variables from the current environment.
+ If PRIVMODE is nonzero, don't import functions from ENV or
+ parse $SHELLOPTS. */
+void
+initialize_shell_variables (env, privmode)
+ char **env;
+ int privmode;
+{
+ char *name, *string, *temp_string;
+ int c, char_index, string_index, string_length;
+ SHELL_VAR *temp_var;
+
+ create_variable_tables ();
for (string_index = 0; string = env[string_index++]; )
{
else
{
temp_var = bind_variable (name, string, 0);
-if (strcmp(name,"LANG") == 0)
- itrace("bound LANG to %s", string);
VSETATTR (temp_var, (att_exported | att_imported));
array_needs_making = 1;
}
set_pwd ();
/* Set up initial value of $_ */
-#if 0
- temp_var = bind_variable ("_", dollar_vars[0], 0);
-#else
temp_var = set_if_not ("_", dollar_vars[0]);
-#endif
/* Remember this pid. */
dollar_dollar_pid = getpid ();
get_comp_wordbreaks (var)
SHELL_VAR *var;
{
- char *p;
-
/* If we don't have anything yet, assign a default value. */
if (rl_completer_word_break_characters == 0 && bash_readline_initialized == 0)
enable_hostname_completion (perform_hostname_completion);
-#if 0
- FREE (value_cell (var));
- p = savestring (rl_completer_word_break_characters);
-
- var_setvalue (var, p);
-#else
var_setvalue (var, rl_completer_word_break_characters);
-#endif
return (var);
}
{
SHELL_VAR *v;
+ if (shell_variables == 0)
+ create_variable_tables ();
+
v = find_variable (name);
if (v == 0)
v = bind_variable_internal (name, value, global_variables->table, HASH_NOSRCH, 0);
/* Make sure we have a shell_variables hash table to add to. */
if (shell_variables == 0)
- {
- shell_variables = global_variables = new_var_context ((char *)NULL, 0);
- shell_variables->scope = 0;
- shell_variables->table = hash_create (0);
- }
+ create_variable_tables ();
elt = hash_insert (savestring (name), table, HASH_NOSRCH);
elt->data = (PTR_T)entry;
VAR_CONTEXT *vc;
if (shell_variables == 0)
- {
- shell_variables = global_variables = new_var_context ((char *)NULL, 0);
- shell_variables->scope = 0;
- shell_variables->table = hash_create (0);
- }
+ create_variable_tables ();
/* If we have a temporary environment, look there first for the variable,
and, if found, modify the value there before modifying it in the
char *lhs, *rhs;
{
register SHELL_VAR *v;
- char *t;
int isint, isarr;
isint = isarr = 0;
#if defined (ARRAY_VARS)
-# if 0
- if (t = xstrchr (lhs, '[')) /*]*/
-# else
if (valid_array_reference (lhs))
-# endif
{
isarr = 1;
v = array_variable_part (lhs, (char **)0, (int *)0);