mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-27 15:43:18 +02:00
commit bash-20050810 snapshot
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
break maybe_make_export_env
|
||||
r --norc
|
||||
qui
|
||||
break maybe_make_export_env
|
||||
r
|
||||
where
|
||||
p export_env
|
||||
p export_env_size
|
||||
qui
|
||||
@@ -11850,3 +11850,43 @@ general.h
|
||||
- fix definitions of ABSPATH and RELPATH for cygwin
|
||||
- fix definition of ISDIRSEP for cygwin to allow backslash as a
|
||||
directory name separator
|
||||
|
||||
8/9
|
||||
---
|
||||
builtins/setattr.def
|
||||
- when setting a variable from the temporary environment in
|
||||
set_var_attribute (e.g., `LC_ALL=C export LC_ALL'), make sure to
|
||||
call stupidly_hack_special_variables after binding the variable in
|
||||
the current context
|
||||
|
||||
builtins/printf.def
|
||||
- make sure to call stupidly_hack_special_variables if using `printf -v'
|
||||
to put formatted output in a shell variable
|
||||
|
||||
8/11
|
||||
----
|
||||
support/shobj-conf
|
||||
- new variable: SHLIB_LIBPREF, prefix for shared library name (defaults
|
||||
to `lib'
|
||||
- new variable: SHLIB_DLLVERSION, used on Cygwin to set the library
|
||||
version number
|
||||
- new variable: SHLIB_DOT, separator character between library name and
|
||||
suffix and version information (defaults to `.')
|
||||
- new stanza for cygwin to generate windows-compatible dll
|
||||
|
||||
8/14
|
||||
----
|
||||
variables.c
|
||||
- new special variable function for Cygwin, so the export environment
|
||||
is remade when HOME is changed. The environment is the only way to
|
||||
get information from the shell to cygwin dlls, for instanace, when
|
||||
bash is compiled to use an already-installed libreadline
|
||||
|
||||
variables.h
|
||||
- new extern declaration for sv_home
|
||||
|
||||
8/15
|
||||
----
|
||||
lib/readline/display.c
|
||||
- call init_line_structures from rl_redisplay if vis_lbreaks == 0
|
||||
to avoid consequences of a poorly-timed SIGWINCH
|
||||
|
||||
@@ -11837,3 +11837,56 @@ variables.c
|
||||
lib/readline/text.c
|
||||
- rewrote rl_change_case to correctly change the case of multibyte
|
||||
characters where appropriate
|
||||
|
||||
8/5
|
||||
---
|
||||
configure.in
|
||||
- remove call to obsolete macro AC_ACVERSION
|
||||
- remove special calls to AC_CYGWIN and AC_MINGW32; AC_CANONICAL_HOST
|
||||
takes care of those cases
|
||||
|
||||
general.h
|
||||
- include `chartypes.h' for definition of ISALPHA
|
||||
- fix definitions of ABSPATH and RELPATH for cygwin
|
||||
- fix definition of ISDIRSEP for cygwin to allow backslash as a
|
||||
directory name separator
|
||||
|
||||
8/9
|
||||
---
|
||||
builtins/setattr.def
|
||||
- when setting a variable from the temporary environment in
|
||||
set_var_attribute (e.g., `LC_ALL=C export LC_ALL'), make sure to
|
||||
call stupidly_hack_special_variables after binding the variable in
|
||||
the current context
|
||||
|
||||
builtins/printf.def
|
||||
- make sure to call stupidly_hack_special_variables if using `printf -v'
|
||||
to put formatted output in a shell variable
|
||||
|
||||
8/11
|
||||
----
|
||||
support/shobj-conf
|
||||
- new variable: SHLIB_LIBPREF, prefix for shared library name (defaults
|
||||
to `lib'
|
||||
- new variable: SHLIB_DLLVERSION, used on Cygwin to set the library
|
||||
version number
|
||||
- new variable: SHLIB_DOT, separator character between library name and
|
||||
suffix and version information (defaults to `.')
|
||||
- new stanza for cygwin to generate windows-compatible dll
|
||||
|
||||
8/14
|
||||
----
|
||||
variables.c
|
||||
- new special variable function for Cygwin, so the export environment
|
||||
is remade when HOME is changed. The environment is the only way to
|
||||
get information from the shell to cygwin dlls, for instanace, when
|
||||
bash is compiled to use an already-installed libreadline
|
||||
|
||||
variables.h
|
||||
- new extern declaration for sv_home
|
||||
|
||||
8/15
|
||||
----
|
||||
lib/readline/display.c
|
||||
- call init_line_structures from rl_redisplay if inv_lbreaks == 0
|
||||
to avoid consequences of a poorly-timed SIGWINCH
|
||||
|
||||
+4
-1
@@ -115,7 +115,10 @@ extern int errno;
|
||||
do \
|
||||
{ \
|
||||
if (vflag) \
|
||||
bind_variable (vname, vbuf, 0); \
|
||||
{ \
|
||||
bind_variable (vname, vbuf, 0); \
|
||||
stupidly_hack_special_variables (vname); \
|
||||
} \
|
||||
if (conv_bufsize > 4096 ) \
|
||||
{ \
|
||||
free (conv_buf); \
|
||||
|
||||
+1
-1
@@ -688,7 +688,7 @@ edit_line (p)
|
||||
char *ret;
|
||||
int len;
|
||||
|
||||
if (!bash_readline_initialized)
|
||||
if (bash_readline_initialized == 0)
|
||||
initialize_readline ();
|
||||
old_attempted_completion_function = rl_attempted_completion_function;
|
||||
rl_attempted_completion_function = (rl_completion_func_t *)NULL;
|
||||
|
||||
+1
-4
@@ -429,11 +429,7 @@ read_builtin (list)
|
||||
if (c == '\n')
|
||||
i--; /* back up over the CTLESC */
|
||||
else
|
||||
#if 0
|
||||
input_string[i++] = c;
|
||||
#else
|
||||
goto add_char;
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -668,6 +664,7 @@ add_char:
|
||||
return (retval);
|
||||
}
|
||||
|
||||
/* XXX - should we call stupidly_hack_special_variables here? */
|
||||
static SHELL_VAR *
|
||||
bind_read_variable (name, value)
|
||||
char *name, *value;
|
||||
|
||||
@@ -416,6 +416,8 @@ set_var_attribute (name, attribute, undo)
|
||||
VSETATTR (var, att_propagate);
|
||||
SETVARATTR (tv, attribute, undo); /* XXX */
|
||||
|
||||
stupidly_hack_special_variables (tv->name);
|
||||
|
||||
free (tvalue);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1131,12 +1131,12 @@ simple calls to `read'. For example, piping a command's output
|
||||
into a `while' loop that repeatedly calls `read' will result in
|
||||
the same behavior.
|
||||
|
||||
Each element of a pipeline runs in a separate process, a child of
|
||||
the shell running the pipeline. A subprocess cannot affect its
|
||||
parent's environment. When the `read' command sets the variable
|
||||
to the input, that variable is set only in the subshell, not the
|
||||
parent shell. When the subshell exits, the value of the variable
|
||||
is lost.
|
||||
Each element of a pipeline, even a builtin or shell function,
|
||||
runs in a separate process, a child of the shell running the
|
||||
pipeline. A subprocess cannot affect its parent's environment.
|
||||
When the `read' command sets the variable to the input, that
|
||||
variable is set only in the subshell, not the parent shell. When
|
||||
the subshell exits, the value of the variable is lost.
|
||||
|
||||
Many pipelines that end with `read variable' can be converted
|
||||
into command substitutions, which will capture the output of
|
||||
|
||||
+771
-763
File diff suppressed because it is too large
Load Diff
@@ -460,7 +460,7 @@ rl_redisplay ()
|
||||
if (!rl_display_prompt)
|
||||
rl_display_prompt = "";
|
||||
|
||||
if (invisible_line == 0)
|
||||
if (invisible_line == 0 || vis_lbreaks == 0)
|
||||
{
|
||||
init_line_structures (0);
|
||||
rl_on_new_line ();
|
||||
|
||||
@@ -254,7 +254,8 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
|
||||
else if (ignoring && *p == RL_PROMPT_END_IGNORE)
|
||||
{
|
||||
ignoring = 0;
|
||||
last = r - ret - 1;
|
||||
if (p[-1] != RL_PROMPT_START_IGNORE)
|
||||
last = r - ret - 1;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
@@ -423,6 +424,7 @@ init_line_structures (minsize)
|
||||
invisible_line[n] = 1;
|
||||
}
|
||||
|
||||
kill(getpid(), SIGWINCH);
|
||||
if (vis_lbreaks == 0)
|
||||
{
|
||||
/* should be enough. */
|
||||
@@ -459,7 +461,7 @@ rl_redisplay ()
|
||||
if (!rl_display_prompt)
|
||||
rl_display_prompt = "";
|
||||
|
||||
if (invisible_line == 0)
|
||||
if (invisible_line == 0 || vis_lbreaks == 0)
|
||||
{
|
||||
init_line_structures (0);
|
||||
rl_on_new_line ();
|
||||
@@ -602,7 +604,6 @@ rl_redisplay ()
|
||||
num = 0;
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "rl_redisplay: local_prompt = %s\r\n", local_prompt);
|
||||
/* prompt_invis_chars_first_line is the number of invisible characters in
|
||||
the first physical line of the prompt.
|
||||
wrap_offset - prompt_invis_chars_first_line is the number of invis
|
||||
|
||||
@@ -41,9 +41,13 @@ SHOBJ_LIBS=
|
||||
|
||||
SHLIB_XLDFLAGS=
|
||||
SHLIB_LIBS=
|
||||
|
||||
SHLIB_DOT='.'
|
||||
SHLIB_LIBPREF='lib'
|
||||
SHLIB_LIBSUFF='so'
|
||||
|
||||
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF)'
|
||||
SHLIB_DLLVERSION='$(SHLIB_MAJOR)'
|
||||
|
||||
PROGNAME=`basename $0`
|
||||
USAGE="$PROGNAME [-C compiler] -c host_cpu -o host_os -v host_vendor"
|
||||
@@ -466,6 +470,24 @@ msdos*)
|
||||
SHLIB_STATUS=unsupported
|
||||
;;
|
||||
|
||||
cygwin*)
|
||||
SHOBJ_LD='$(CC)'
|
||||
SHOBJ_LDFLAGS='-shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base -Wl,--export-all -Wl,--out-implib=$(@).a'
|
||||
SHLIB_LIBPREF='cyg'
|
||||
SHLIB_LIBSUFF='dll'
|
||||
SHLIB_LIBVERSION='$(SHLIB_DLLVERSION).$(SHLIB_LIBSUFF)'
|
||||
SHLIB_LIBS='$(TERMCAP_LIB)'
|
||||
|
||||
SHLIB_DOT=
|
||||
# For official cygwin releases, DLLVERSION will be defined in the
|
||||
# environment of configure, and will be incremented any time the API
|
||||
# changes in a non-backwards compatible manner. Otherwise, it is just
|
||||
# SHLIB_MAJOR.
|
||||
if [ -n "$DLLVERSION" ] ; then
|
||||
SHLIB_DLLVERSION="$DLLVERSION"
|
||||
fi
|
||||
;;
|
||||
|
||||
#
|
||||
# Rely on correct gcc configuration for everything else
|
||||
#
|
||||
@@ -493,8 +515,14 @@ echo SHOBJ_LIBS=\'"$SHOBJ_LIBS"\'
|
||||
|
||||
echo SHLIB_XLDFLAGS=\'"$SHLIB_XLDFLAGS"\'
|
||||
echo SHLIB_LIBS=\'"$SHLIB_LIBS"\'
|
||||
|
||||
echo SHLIB_DOT=\'"$SHLIB_DOT"\'
|
||||
|
||||
echo SHLIB_LIBPREF=\'"$SHLIB_LIBPREF"\'
|
||||
echo SHLIB_LIBSUFF=\'"$SHLIB_LIBSUFF"\'
|
||||
|
||||
echo SHLIB_LIBVERSION=\'"$SHLIB_LIBVERSION"\'
|
||||
echo SHLIB_DLLVERSION=\'"$SHLIB_DLLVERSION"\'
|
||||
|
||||
echo SHOBJ_STATUS=\'"$SHOBJ_STATUS"\'
|
||||
echo SHLIB_STATUS=\'"$SHLIB_STATUS"\'
|
||||
|
||||
+15
@@ -3736,6 +3736,10 @@ static struct name_and_function special_vars[] = {
|
||||
{ "HISTTIMEFORMAT", sv_histtimefmt },
|
||||
#endif
|
||||
|
||||
#if defined (__CYGWIN__)
|
||||
{ "HOME", sv_home },
|
||||
#endif
|
||||
|
||||
#if defined (READLINE)
|
||||
{ "HOSTFILE", sv_hostfile },
|
||||
#endif
|
||||
@@ -3924,6 +3928,17 @@ sv_hostfile (name)
|
||||
}
|
||||
#endif /* READLINE */
|
||||
|
||||
/* Update the value of HOME in the export environment so tilde expansion will
|
||||
work on cygwin. */
|
||||
#if defined (__CYGWIN__)
|
||||
sv_home (name)
|
||||
char *name;
|
||||
{
|
||||
array_needs_making = 1;
|
||||
maybe_make_export_env ();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (HISTORY)
|
||||
/* What to do after the HISTSIZE or HISTFILESIZE variables change.
|
||||
If there is a value for this HISTSIZE (and it is numeric), then stifle
|
||||
|
||||
+35
-5
@@ -25,8 +25,12 @@
|
||||
#include "posixtime.h"
|
||||
|
||||
#if defined (qnx)
|
||||
# include <sys/vc.h>
|
||||
#endif
|
||||
# if defined (qnx6)
|
||||
# include <sy/netmgr.h>
|
||||
# else
|
||||
# include <sys/vc.h>
|
||||
# endif /* !qnx6 */
|
||||
#endif /* qnx */
|
||||
|
||||
#if defined (HAVE_UNISTD_H)
|
||||
# include <unistd.h>
|
||||
@@ -70,6 +74,8 @@
|
||||
|
||||
#define ifsname(s) ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0')
|
||||
|
||||
extern char **environ;
|
||||
|
||||
/* Variables used here and defined in other files. */
|
||||
extern int posixly_correct;
|
||||
extern int line_number;
|
||||
@@ -350,7 +356,7 @@ initialize_shell_variables (env, privmode)
|
||||
set_pwd ();
|
||||
|
||||
/* Set up initial value of $_ */
|
||||
#if 1
|
||||
#if 0
|
||||
temp_var = bind_variable ("_", dollar_vars[0], 0);
|
||||
#else
|
||||
temp_var = set_if_not ("_", dollar_vars[0]);
|
||||
@@ -375,7 +381,11 @@ initialize_shell_variables (env, privmode)
|
||||
/* set node id -- don't import it from the environment */
|
||||
{
|
||||
char node_name[22];
|
||||
# if defined (qnx6)
|
||||
netmgr_ndtostr(ND2S_LOCAL_STR, ND_LOCAL_NODE, node_name, sizeof(node_name));
|
||||
# else
|
||||
qnx_nidtostr (getnid (), node_name, sizeof (node_name));
|
||||
# endif
|
||||
temp_var = bind_variable ("NODE", node_name, 0);
|
||||
set_auto_export (temp_var);
|
||||
}
|
||||
@@ -1809,7 +1819,7 @@ make_variable_value (var, value, flags)
|
||||
{
|
||||
if (flags & ASS_APPEND)
|
||||
{
|
||||
oval = value_cell (var);
|
||||
oval = get_variable_value (var);
|
||||
if (oval == 0) /* paranoia */
|
||||
oval = "";
|
||||
olen = STRLEN (oval);
|
||||
@@ -3134,6 +3144,7 @@ do \
|
||||
{ \
|
||||
export_env_size += 16; \
|
||||
export_env = strvec_resize (export_env, export_env_size); \
|
||||
environ = export_env; \
|
||||
} \
|
||||
export_env[export_env_index++] = (do_alloc) ? savestring (envstr) : envstr; \
|
||||
export_env[export_env_index] = (char *)NULL; \
|
||||
@@ -3243,6 +3254,7 @@ maybe_make_export_env ()
|
||||
{
|
||||
export_env_size = new_size;
|
||||
export_env = strvec_resize (export_env, export_env_size);
|
||||
environ = export_env;
|
||||
}
|
||||
export_env[export_env_index = 0] = (char *)NULL;
|
||||
|
||||
@@ -3724,6 +3736,10 @@ static struct name_and_function special_vars[] = {
|
||||
{ "HISTTIMEFORMAT", sv_histtimefmt },
|
||||
#endif
|
||||
|
||||
#if defined (READLINE)
|
||||
{ "HOME", sv_home },
|
||||
#endif
|
||||
|
||||
#if defined (READLINE)
|
||||
{ "HOSTFILE", sv_hostfile },
|
||||
#endif
|
||||
@@ -3898,6 +3914,18 @@ sv_terminal (name)
|
||||
rl_reset_terminal (get_string_value ("TERM"));
|
||||
}
|
||||
|
||||
/* Update the value of HOME in the export environment so tilde expansion will
|
||||
work on cygwin. */
|
||||
sv_home (name)
|
||||
char *name;
|
||||
{
|
||||
if (interactive_shell && no_line_editing == 0)
|
||||
{
|
||||
array_needs_making = 1;
|
||||
maybe_make_export_env ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
sv_hostfile (name)
|
||||
char *name;
|
||||
@@ -3925,6 +3953,7 @@ sv_histsize (name)
|
||||
{
|
||||
char *temp;
|
||||
intmax_t num;
|
||||
int hmax;
|
||||
|
||||
temp = get_string_value (name);
|
||||
|
||||
@@ -3934,7 +3963,8 @@ sv_histsize (name)
|
||||
{
|
||||
if (name[4] == 'S')
|
||||
{
|
||||
stifle_history (num);
|
||||
hmax = num;
|
||||
stifle_history (hmax);
|
||||
num = where_history ();
|
||||
if (history_lines_this_session > num)
|
||||
history_lines_this_session = num;
|
||||
|
||||
+6
-2
@@ -344,8 +344,8 @@ extern void sv_terminal __P((char *));
|
||||
extern void sv_hostfile __P((char *));
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
|
||||
extern void sv_tz __P((char *));
|
||||
#if defined (__CYGWIN__)
|
||||
extern void sv_home __P((char *));
|
||||
#endif
|
||||
|
||||
#if defined (HISTORY)
|
||||
@@ -358,4 +358,8 @@ extern void sv_histchars __P((char *));
|
||||
extern void sv_histtimefmt __P((char *));
|
||||
#endif /* HISTORY */
|
||||
|
||||
#if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)
|
||||
extern void sv_tz __P((char *));
|
||||
#endif
|
||||
|
||||
#endif /* !_VARIABLES_H_ */
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
/* variables.h -- data structures for shell variables. */
|
||||
|
||||
/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -341,6 +341,7 @@ extern void sv_locale __P((char *));
|
||||
#if defined (READLINE)
|
||||
extern void sv_comp_wordbreaks __P((char *));
|
||||
extern void sv_terminal __P((char *));
|
||||
extern void sv_home __P((char *));
|
||||
extern void sv_hostfile __P((char *));
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user