commit bash-20040702 snapshot

This commit is contained in:
Chet Ramey
2011-12-03 12:58:47 -05:00
parent dd9e6dfa23
commit 56299fa501
39 changed files with 15615 additions and 1698 deletions
+21
View File
@@ -52,6 +52,19 @@ o. Fixed a problem with calls to getcwd() so that bash now operates better
p. The `trap' builtin now reports an error if a single non-signal argument
is specified.
q. Fixed a bug that caused `umask' to not work correctly when presented
with a mask of all 0s.
r. When `getopts' reaches the end of options, OPTARG is unset, as POSIX
appears to specify.
s. Interactive mode now depends on whether or not stdin and stderr are
connected to a tty; formerly it was stdin and stdout. POSIX requires
this.
t. Fixed vi-mode completion to work more as POSIX specifies (e.g., doing the
right kind of filename generation).
2. Changes to Readline
a. Fixed a problem that could cause readline to refer to freed memory when
@@ -69,6 +82,9 @@ d. Fixed a bug in vi-mode that caused multi-digit count arguments to work
e. Fixed a problem in vi-mode that caused the last text modification command
to not be remembered across different command lines.
f. Fixed problems with changing characters and changing case at the end of
the line.
3. New Features in Bash
a. The `jobs', `kill', and `wait' builtins now accept job control notation
@@ -78,6 +94,11 @@ b. The historical behavior of `trap' that allows a missing `action' argument
to cause each specified signal's handling to be reset to its default is
now only supported when `trap' is given a single non-option argument.
4. New Features in Readline
a. When listing completions, directories have a `/' appended if the
`mark-directories' option has been enabled.
------------------------------------------------------------------------------
This document details the changes between this version, bash-3.0-beta1,
and the previous version, bash-3.0-alpha.
+123 -1
View File
@@ -1,3 +1,105 @@
This document details the changes between this version, bash-3.0-rc1,
and the previous version, bash-3.0-beta1.
1. Changes to Bash
a. Fixed a bug that caused incorrect behavior when referecing element 0 of
an array using $array, element 0 was unset, and `set -u' was enabled.
b. System-specific changes for: SCO Unix 3.2, Tandem.
c. Fixed a bug that caused inappropriate word splitting when a variable was
expanded within a double-quoted string that also included $@.
d. Fixed a bug that caused `pwd' to not display anything in physical mode
when the file system had changed underneath the shell.
e. Fixed a bug in the pre- and post- increment and decrement parsing in the
expression evaluator that caused errors when the operands and corresponding
operators were separated by whitespace.
f. Fixed a bug that caused `history -p' to add an entry to the history list,
counter to the documentation. (Keeps the history expansions invoked by
emacs-mode command line editing from doing that as well.)
g. Fixed a bug that could cause a core dump if `cd' is asked to print out a
pathname longer than PATH_MAX characters.
h. Fixed a bug that caused jobs to be put into the wrong process group under
some circumstances after enabling job control with `set -m'.
i. `unalias' now returns failure if no alias name arguments are supplied.
j. Documented the characters not allowed to appear in an alias name.
k. $* is no longer expanded as if in double quotes when it appears in the
body of a here document, as the SUS seems to require.
l. The `bashbug' script now uses a directory in $TMPDIR for exclusive
access rather than trying to guess how the underlying OS provides for
secure temporary file creation.
m. Fixed a few problems with `cd' and `pwd' when asked to operate on pathnames
longer than PATH_MAX characters.
n. Fixed a memory leak caused when creating multiple local array variables
with identical names.
o. Fixed a problem with calls to getcwd() so that bash now operates better
when the full pathname to the current directory is longer than PATH_MAX
bytes.
p. The `trap' builtin now reports an error if a single non-signal argument
is specified.
q. Fixed a bug that caused `umask' to not work correctly when presented
with a mask of all 0s.
r. When `getopts' reaches the end of options, OPTARG is unset, as POSIX
appears to specify.
s. Interactive mode now depends on whether or not stdin and stderr are
connected to a tty; formerly it was stdin and stdout. POSIX requires
this.
t. Fixed vi-mode completion to work more as POSIX specifies (e.g., doing the
right kind of filename generation).
2. Changes to Readline
a. Fixed a problem that could cause readline to refer to freed memory when
moving between history lines while doing searches.
b. Improvements to the code that expands and displays prompt strings
containing multibyte characters.
c. Fixed a problem with vi-mode not correctly remembering the numeric argument
to the last `c'hange command for later use with `.'.
d. Fixed a bug in vi-mode that caused multi-digit count arguments to work
incorrectly.
e. Fixed a problem in vi-mode that caused the last text modification command
to not be remembered across different command lines.
f. Fixed problems with changing characters and changing case at the end of
the line.
3. New Features in Bash
a. The `jobs', `kill', and `wait' builtins now accept job control notation
even if job control is not enabled.
b. The historical behavior of `trap' that allows a missing `action' argument
to cause each specified signal's handling to be reset to its default is
now only supported when `trap' is given a single non-option argument.
4. New Features in Readline
a. When listing completions, directories have a `/' appended if the
`mark-directories' option has been enabled.
------------------------------------------------------------------------------
This document details the changes between this version, bash-3.0-beta1,
and the previous version, bash-3.0-alpha.
@@ -57,7 +159,7 @@ q. Fixed a bug that could cause core dumps when checking whether a quoted
command name was being completed.
r. Fixes to the pattern removal and pattern replacement expansions to deal
with multibyte characters better.
with multibyte characters better (and faster).
s. Fix to the substring expansion (${param:off[:len]}) to deal with (possibly
multibyte) characters instead of raw bytes.
@@ -75,6 +177,12 @@ w. Fixed a bug that caused "$@" to expand incorrectly when used as the right
hand side of a parameter expansion such as ${word:="$@"} if the first
character of $IFS was not a space.
x. Fixed a slight cosmetic problem when printing commands containing a
`>&word' redirection.
y. Fixed a problem that could cause here documents to not be created correctly
if the system temporary directory did not allow writing.
2. Changes to Readline
a. Change to history expansion functions to treat `^' as equivalent to word
@@ -101,6 +209,9 @@ g. Fixed some display (and other) bugs encountered in multibyte locales
h. Fixed some display bugs caused by multibyte characters in prompt strings.
i. Fixed a problem with history expansion caused by non-whitespace characters
used as history word delimiters.
3. New Features in Bash
a. printf builtin understands two new escape sequences: \" and \?.
@@ -112,6 +223,10 @@ c. The GNU `gettext' package and libintl have been integrated; the shell's
d. The `\W' prompt expansion now abbreviates $HOME as `~', like `\w'.
e. The error message printed when bash cannot open a shell script supplied
as argument 1 now includes the name of the shell, to better identify
the error as coming from bash.
4. New Features in Readline
a. New application variable, rl_completion_quote_character, set to any
@@ -126,6 +241,13 @@ c. New application variable, rl_completion_found_quote, set to a non-zero
value if readline determines that the word to be completed is quoted.
Set before readline calls any application completion function.
d. New function hook, rl_completion_word_break_hook, called when readline
needs to break a line into words when completion is attempted. Allows
the word break characters to vary based on position in the line.
e. New bindable command: unix-filename-rubout. Does the same thing as
unix-word-rubout, but adds `/' to the set of word delimiters.
------------------------------------------------------------------------------
This document details the changes between this version, bash-3.0-alpha,
and the previous version, bash-2.05b-release.
+49
View File
@@ -9555,3 +9555,52 @@ lib/readline/vi_mode.c
builtins/echo.def
- call clearerr(stdout) before writing anything and testing its
failure or success
6/29
----
bashline.c
- only set rl_explicit_arg in bash_glob_complete_word if readline is
in emacs mode; let bash_vi_complete take care of setting it in vi
mode
- fix bash_vi_complete to only set rl_explicit_arg unless the posix
conditions are met: no globbing characters in the vi `bigword'
being completed
6/30
----
[bash-3.0-rc1 released]
7/1
---
lib/readline/complete.c
- make sure `extension_char' is initialized before deciding whether
or not the append a `/' to a possible completion when visible-stats
is not enabled
7/2
---
subst.c
- fix a boundary overrun in string_extract_double_quoted that could
occur when the word completion code attempts to expand an incomplete
construct (like a quoted unclosed command substitution)
7/4
---
subst.c
- set tempenv_assign_error to non-zero if an assignment to the
temporary environment fails for some reason (e.g., attempted
assignment to a readonly variable)
execute_cmd.c
- fix execute_simple_command to force a non-interactive shell in
POSIX mode to exit if an assignment to the temporary environment
preceding a special builtin fails (bug report from
llattanzi@apple.com)
7/5
---
bashline.c
- in bash_directory_completion_hook, don't perform word expansions
if the filename appears to have been completed from the file
system rather than typed in by the user. Bug reported by Tim
Waugh <twaugh@redhat.com>
+49
View File
@@ -9547,3 +9547,52 @@ lib/readline/vi_mode.c
command
- fix rl_vi_change_char so that replacing characters up to EOL works
rather than generating rl_ding
- fix rl_vi_change_case so that replacing characters up to EOL works
rather than generating rl_ding
6/28
----
builtins/echo.def
- call clearerr(stdout) before writing anything and testing its
failure or success
6/29
----
bashline.c
- only set rl_explicit_arg in bash_glob_complete_word if readline is
in emacs mode; let bash_vi_complete take care of setting it in vi
mode
- fix bash_vi_complete to only set rl_explicit_arg unless the posix
conditions are met: no globbing characters in the vi `bigword'
being completed
6/30
----
[bash-3.0-rc1 released]
7/1
---
lib/readline/complete.c
- make sure `extension_char' is initialized before deciding whether
or not the append a `/' to a possible completion when visible-stats
is not enabled
7/2
---
subst.c
- fix a boundary overrun in string_extract_double_quoted that could
occur when the word completion code attempts to expand an incomplete
construct (like a quoted unclosed command substitution)
7/4
---
subst.c
- set tempenv_assign_error to non-zero if an assignment to the
temporary environment fails for some reason (e.g., attempted
assignment to a readonly variable)
execute_cmd.c
- fix execute_simple_command to force a non-interactive shell in
POSIX mode to exit if an assignment to the temporary environment
preceding a special builtin fails (bug report from
llattanzi@apple.com)
+6 -9
View File
@@ -128,19 +128,13 @@ ll. The error message printed when bash cannot open a shell script supplied
as argument 1 now includes the name of the shell, to better identify
the error as coming from bash.
mm. A bug that caused here documents to not work if the directory the shell
used for the temporary files was not writable has been fixed.
nn. The parameter pattern removal and substitution expansions are now much
mm. The parameter pattern removal and substitution expansions are now much
faster and more efficient when using multibyte characters.
oo. Fixed a bug in the `shift' builtin that could cause core dumps when
reporting an out-of-range argument.
pp. The `jobs', `kill', and `wait' builtins now accept job control notation
nn. The `jobs', `kill', and `wait' builtins now accept job control notation
even if job control is not enabled.
qq. The historical behavior of `trap' that allows a missing `action' argument
oo. The historical behavior of `trap' that allows a missing `action' argument
to cause each specified signal's handling to be reset to its default is
now only supported when `trap' is given a single non-option argument.
@@ -194,6 +188,9 @@ l. New function hook, rl_completion_word_break_hook, called when readline
m. New bindable command: unix-filename-rubout. Does the same thing as
unix-word-rubout, but adds `/' to the set of word delimiters.
n. When listing completions, directories have a `/' appended if the
`mark-directories' option has been enabled.
-------------------------------------------------------------------------------
This is a terse description of the new features added to bash-2.05b since
the release of bash-2.05a. As always, the manual page (doc/bash.1) is
+7
View File
@@ -140,6 +140,10 @@ oo. Fixed a bug in the `shift' builtin that could cause core dumps when
pp. The `jobs', `kill', and `wait' builtins now accept job control notation
even if job control is not enabled.
qq. The historical behavior of `trap' that allows a missing `action' argument
to cause each specified signal's handling to be reset to its default is
now only supported when `trap' is given a single non-option argument.
2. New Features in Readline
a. History expansion has a new `a' modifier equivalent to the `g' modifier
@@ -190,6 +194,9 @@ l. New function hook, rl_completion_word_break_hook, called when readline
m. New bindable command: unix-filename-rubout. Does the same thing as
unix-word-rubout, but adds `/' to the set of word delimiters.
n. When listing completions, directories have a `/' appended if the
`mark-directories' option has been enabled.
-------------------------------------------------------------------------------
This is a terse description of the new features added to bash-2.05b since
the release of bash-2.05a. As always, the manual page (doc/bash.1) is
+29 -3
View File
@@ -2196,6 +2196,7 @@ bash_directory_completion_hook (dirname)
char *local_dirname, *new_dirname, *t;
int return_value, should_expand_dirname;
WORD_LIST *wl;
struct stat sb;
return_value = should_expand_dirname = 0;
local_dirname = *dirname;
@@ -2213,6 +2214,13 @@ bash_directory_completion_hook (dirname)
}
#endif
#if defined (HAVE_LSTAT)
if (should_expand_dirname && lstat (local_dirname, &sb) == 0)
#else
if (should_expand_dirname && stat (local_dirname, &sb) == 0)
#endif
should_expand_dirname = 0;
if (should_expand_dirname)
{
new_dirname = savestring (local_dirname);
@@ -2566,7 +2574,8 @@ bash_glob_complete_word (count, key)
int r;
rl_quote_func_t *orig_quoting_function;
rl_explicit_arg = 1; /* force `*' append */
if (rl_editing_mode == EMACS_EDITING_MODE)
rl_explicit_arg = 1; /* force `*' append */
orig_quoting_function = rl_filename_quoting_function;
rl_filename_quoting_function = bash_glob_quote_filename;
@@ -2624,7 +2633,8 @@ bash_vi_complete (count, key)
int count, key;
{
#if defined (SPECIFIC_COMPLETION_FUNCTIONS)
int r;
int p, r;
char *t;
if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point])))
{
@@ -2633,7 +2643,23 @@ bash_vi_complete (count, key)
rl_point++;
}
rl_explicit_arg = 1; /* XXX - force glob_complete_word to append `*' */
/* Find boundaries of current word, according to vi definition of a
`bigword'. */
t = 0;
if (rl_point > 0)
{
p = rl_point;
rl_vi_bWord (1, 'B');
r = rl_point;
rl_point = p;
p = r;
t = substring (rl_line_buffer, p, rl_point);
}
if (t && glob_pattern_p (t) == 0)
rl_explicit_arg = 1; /* XXX - force glob_complete_word to append `*' */
FREE (t);
if (key == '*') /* Expansion and replacement. */
r = bash_glob_expand_word (count, key);
+25 -3
View File
@@ -2196,6 +2196,7 @@ bash_directory_completion_hook (dirname)
char *local_dirname, *new_dirname, *t;
int return_value, should_expand_dirname;
WORD_LIST *wl;
struct stat sb;
return_value = should_expand_dirname = 0;
local_dirname = *dirname;
@@ -2213,6 +2214,9 @@ bash_directory_completion_hook (dirname)
}
#endif
if (should_expand_dirname && lstat (local_dirname, &sb) == 0)
should_expand_dirname = 0;
if (should_expand_dirname)
{
new_dirname = savestring (local_dirname);
@@ -2566,7 +2570,8 @@ bash_glob_complete_word (count, key)
int r;
rl_quote_func_t *orig_quoting_function;
rl_explicit_arg = 1; /* force `*' append */
if (rl_editing_mode == EMACS_EDITING_MODE)
rl_explicit_arg = 1; /* force `*' append */
orig_quoting_function = rl_filename_quoting_function;
rl_filename_quoting_function = bash_glob_quote_filename;
@@ -2624,7 +2629,8 @@ bash_vi_complete (count, key)
int count, key;
{
#if defined (SPECIFIC_COMPLETION_FUNCTIONS)
int r;
int p, r;
char *t;
if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point])))
{
@@ -2633,7 +2639,23 @@ bash_vi_complete (count, key)
rl_point++;
}
rl_explicit_arg = 1; /* XXX - force `*' to be appended */
/* Find boundaries of current word, according to vi definition of a
`bigword'. */
t = 0;
if (rl_point > 0)
{
p = rl_point;
rl_vi_bWord (1, 'B');
r = rl_point;
rl_point = p;
p = r;
t = substring (rl_line_buffer, p, rl_point);
}
if (t && glob_pattern_p (t) == 0)
rl_explicit_arg = 1; /* XXX - force glob_complete_word to append `*' */
FREE (t);
if (key == '*') /* Expansion and replacement. */
r = bash_glob_expand_word (count, key);
+1791
View File
File diff suppressed because it is too large Load Diff
+1771
View File
File diff suppressed because it is too large Load Diff
+112 -148
View File
@@ -1,10 +1,10 @@
This is bashref.info, produced by makeinfo version 4.5 from
/usr/homes/chet/src/bash/src/doc/bashref.texi.
This is bashref.info, produced by makeinfo version 4.2 from
/Users/chet/src/bash/src/doc/bashref.texi.
This text is a brief description of the features that are present in
the Bash shell (version 3.0-rc1, 27 May 2004).
the Bash shell (version 3.0-rc1, 26 June 2004).
This is Edition 3.0, last updated 27 May 2004, of `The GNU Bash
This is Edition 3.0, last updated 26 June 2004, of `The GNU Bash
Reference Manual', for `Bash', Version 3.0-rc1.
Copyright (C) 1988-2004 Free Software Foundation, Inc.
@@ -37,9 +37,9 @@ Bash Features
*************
This text is a brief description of the features that are present in
the Bash shell (version 3.0-rc1, 27 May 2004)..
the Bash shell (version 3.0-rc1, 26 June 2004)..
This is Edition 3.0, last updated 27 May 2004, of `The GNU Bash
This is Edition 3.0, last updated 26 June 2004, of `The GNU Bash
Reference Manual', for `Bash', Version 3.0-rc1.
Bash contains features that appear in other popular shells, and some
@@ -731,7 +731,6 @@ syntax, it may be replaced with one or more newlines.
command in LIST that is executed, or false if any of the
expressions is invalid.
The `break' and `continue' builtins (*note Bourne Shell Builtins::)
may be used to control loop execution.
@@ -896,7 +895,6 @@ Conditional Constructs
value of EXPRESSION1 is sufficient to determine the return value
of the entire conditional expression.

File: bashref.info, Node: Command Grouping, Prev: Conditional Constructs, Up: Compound Commands
@@ -1301,7 +1299,6 @@ the expanded value.
`~-N'
The string that would be displayed by `dirs -N'

File: bashref.info, Node: Shell Parameter Expansion, Next: Command Substitution, Prev: Tilde Expansion, Up: Shell Expansions
@@ -1448,7 +1445,6 @@ if the colon is omitted, the operator tests only for existence.
member of the array in turn, and the expansion is the resultant
list.

File: bashref.info, Node: Command Substitution, Next: Arithmetic Expansion, Prev: Shell Parameter Expansion, Up: Shell Expansions
@@ -1756,7 +1752,6 @@ redirections, as described in the following table:
integer port number or service name, Bash attempts to open a UDP
connection to the corresponding socket.
A failure to open or create a file causes the redirection to fail.
Redirecting Input
@@ -2718,7 +2713,6 @@ POSIX 1003.2 standard.
`-x KEYSEQ:SHELL-COMMAND'
Cause SHELL-COMMAND to be executed whenever KEYSEQ is entered.
The return status is zero unless an invalid option is supplied or
an error occurs.
@@ -3014,7 +3008,6 @@ POSIX 1003.2 standard.
`-u FD'
Read input from file descriptor FD.
`shopt'
shopt [-pqsu] [-o] [OPTNAME ...]
Toggle the values of variables controlling optional shell behavior.
@@ -3224,7 +3217,6 @@ POSIX 1003.2 standard.
If set, the `echo' builtin expands backslash-escape sequences
by default.
The return status when listing options is zero if all OPTNAMES are
enabled, non-zero otherwise. When setting or unsetting options,
the return status is zero unless an OPTNAME is not a valid shell
@@ -3318,7 +3310,6 @@ POSIX 1003.2 standard.
`-v'
The maximum amount of virtual memory available to the process.
If LIMIT is given, it is the new value of the specified resource;
the special LIMIT values `hard', `soft', and `unlimited' stand for
the current hard limit, the current soft limit, and no limit,
@@ -3339,7 +3330,6 @@ POSIX 1003.2 standard.
Remove each NAME from the list of aliases. If `-a' is supplied,
all aliases are removed. Aliases are described in *Note Aliases::.

File: bashref.info, Node: The Set Builtin, Next: Special Builtins, Prev: Bash Builtins, Up: Shell Builtin Commands
@@ -3686,7 +3676,6 @@ shell. In some cases, Bash assigns a default value to the variable.
`PS2'
The secondary prompt string. The default value is `> '.

File: bashref.info, Node: Bash Variables, Prev: Bourne Shell Variables, Up: Shell Variables
@@ -3779,7 +3768,6 @@ Variables::).
`BASH_VERSINFO[5]'
The value of `MACHTYPE'.
`BASH_VERSION'
The version number of the current instance of Bash.
@@ -4165,7 +4153,6 @@ Variables::).
The numeric real user id of the current user. This variable is
readonly.

File: bashref.info, Node: Bash Features, Next: Job Control, Prev: Shell Variables, Up: Top
@@ -4263,7 +4250,6 @@ the single-character options to be recognized.
Show version information for this instance of Bash on the standard
output and exit successfully.
There are several single-character options that may be supplied at
invocation which are not available with the `set' builtin.
@@ -4315,7 +4301,6 @@ invocation which are not available with the `set' builtin.
processing. Any arguments after the `--' are treated as filenames
and arguments.
A _login_ shell is one whose first character of argument zero is
`-', or one invoked with the `--login' option.
@@ -4467,8 +4452,8 @@ What is an Interactive Shell?
An interactive shell is one started without non-option arguments,
unless `-s' is specified, without specifiying the `-c' option, and
whose input and output are both connected to terminals (as determined
by `isatty(3)'), or one started with the `-i' option.
whose input and error output are both connected to terminals (as
determined by `isatty(3)'), or one started with the `-i' option.
An interactive shell generally reads from and writes to a user's
terminal.
@@ -4707,7 +4692,6 @@ checked. If the FILE argument to one of the primaries is one of
greater than or equal to ARG2, respectively. ARG1 and ARG2 may be
positive or negative integers.

File: bashref.info, Node: Shell Arithmetic, Next: Aliases, Prev: Bash Conditional Expressions, Up: Bash Features
@@ -5025,7 +5009,6 @@ Directory Stack Builtins
Makes the current working directory be the top of the stack,
and then executes the equivalent of ``cd' DIR'. `cd's to DIR.

File: bashref.info, Node: Printing a Prompt, Next: The Restricted Shell, Prev: The Directory Stack, Up: Bash Features
@@ -5542,7 +5525,6 @@ Job Control Builtins
signal. The `-f' option means to suspend even if the shell is a
login shell.
When job control is not active, the `kill' and `wait' builtins do
not accept JOBSPEC arguments. They must be supplied process IDs.
@@ -5569,7 +5551,6 @@ Job Control Variables
a prefix of a stopped job's name; this provides functionality
analogous to the `%' job ID.

File: bashref.info, Node: Command Line Editing, Next: Installing Bash, Prev: Using History Interactively, Up: Top
@@ -5776,7 +5757,6 @@ available to be yanked back later, when you are typing another line.
Kill from the cursor to the previous whitespace. This is
different than `M-<DEL>' because the word boundaries differ.
Here is how to "yank" the text back into the line. Yanking means to
copy the most-recently-killed text from the kill buffer.
@@ -6054,7 +6034,6 @@ Variable Settings
appended to the filename when listing possible completions.
The default is `off'.
Key Bindings
The syntax for controlling key bindings in the init file is
simple. First you need to find the name of the command that you
@@ -6109,7 +6088,6 @@ Key Bindings
`<ESC> <[> <1> <1> <~>' is bound to insert the text `Function
Key 1'.
The following GNU Emacs style escape sequences are available when
specifying key sequences:
@@ -6175,7 +6153,6 @@ Key Bindings
the line:
"\C-x\\": "\\"

File: bashref.info, Node: Conditional Init Constructs, Next: Sample Init File, Prev: Readline Init File Syntax, Up: Readline Init File
@@ -6407,7 +6384,6 @@ Commands For Moving
`redraw-current-line ()'
Refresh the current line. By default, this is unbound.

File: bashref.info, Node: Commands For History, Next: Commands For Text, Prev: Commands For Moving, Up: Bindable Readline Commands
@@ -6478,7 +6454,6 @@ Commands For Manipulating The History
through the history list, inserting the last argument of each line
in turn.

File: bashref.info, Node: Commands For Text, Next: Commands For Killing, Prev: Commands For History, Up: Bindable Readline Commands
@@ -6543,7 +6518,6 @@ Commands For Changing Text
By default, this command is unbound.

File: bashref.info, Node: Commands For Killing, Next: Numeric Arguments, Prev: Commands For Text, Up: Bindable Readline Commands
@@ -6724,7 +6698,6 @@ Letting Readline Type For You
completions enclosed within braces so the list is available to the
shell (*note Brace Expansion::).

File: bashref.info, Node: Keyboard Macros, Next: Miscellaneous Commands, Prev: Commands For Completion, Up: Bindable Readline Commands
@@ -6742,7 +6715,6 @@ Keyboard Macros
Re-execute the last keyboard macro defined, by making the
characters in the macro appear as if typed at the keyboard.

File: bashref.info, Node: Miscellaneous Commands, Prev: Keyboard Macros, Up: Bindable Readline Commands
@@ -6877,7 +6849,6 @@ Some Miscellaneous Commands
result as shell commands. Bash attempts to invoke `$VISUAL',
`$EDITOR', and `emacs' as the editor, in that order.

File: bashref.info, Node: Readline vi Mode, Next: Programmable Completion, Prev: Bindable Readline Commands, Up: Command Line Editing
@@ -7210,7 +7181,6 @@ completion facilities.
for a NAME for which no specification exists, or an error occurs
adding a completion specification.

File: bashref.info, Node: Using History Interactively, Next: Command Line Editing, Prev: Job Control, Up: Top
@@ -7369,12 +7339,10 @@ and history file.
The ARGs are added to the end of the history list as a single
entry.
When any of the `-w', `-r', `-a', or `-n' options is used, if
FILENAME is given, then it is used as the history file. If not,
then the value of the `HISTFILE' variable is used.

File: bashref.info, Node: History Interaction, Prev: Bash History Builtins, Up: Using History Interactively
@@ -7464,7 +7432,6 @@ history list.
`!#'
The entire command line typed so far.

File: bashref.info, Node: Word Designators, Next: Modifiers, Prev: Event Designators, Up: History Interaction
@@ -7523,7 +7490,6 @@ line separated by single spaces.
`X-'
Abbreviates `X-$' like `X*', but omits the last word.
If a word designator is supplied without an event specification, the
previous command is used as the event.
@@ -7578,7 +7544,6 @@ more of the following modifiers, each preceded by a `:'.
`G'
Apply the following `s' modifier once to each word in the event.

File: bashref.info, Node: Installing Bash, Next: Reporting Bugs, Prev: Command Line Editing, Up: Top
@@ -8012,7 +7977,6 @@ does not provide the necessary support.
Specification, version 2. *Note Bash Builtins::, for a
description of the escape sequences that `echo' recognizes.
The file `config-top.h' contains C Preprocessor `#define' statements
for options which are not settable from `configure'. Some of these are
not meant to be changed; beware of the consequences if you do. Read
@@ -9266,7 +9230,7 @@ Concept Index

Tag Table:
Node: Top1359
Node: Top1357
Node: Introduction3504
Node: What is Bash?3729
Node: What is a shell?4817
@@ -9287,108 +9251,108 @@ Node: Pipelines20515
Node: Lists22381
Node: Compound Commands24003
Node: Looping Constructs24775
Node: Conditional Constructs27209
Node: Command Grouping34262
Node: Shell Functions35698
Node: Shell Parameters39960
Node: Positional Parameters41531
Node: Special Parameters42422
Node: Shell Expansions45080
Node: Brace Expansion47000
Node: Tilde Expansion49316
Node: Shell Parameter Expansion51648
Node: Command Substitution58902
Node: Arithmetic Expansion60224
Node: Process Substitution61065
Node: Word Splitting62102
Node: Filename Expansion63554
Node: Pattern Matching65678
Node: Quote Removal68999
Node: Redirections69285
Node: Executing Commands76760
Node: Simple Command Expansion77427
Node: Command Search and Execution79348
Node: Command Execution Environment81345
Node: Environment84107
Node: Exit Status85758
Node: Signals86953
Node: Shell Scripts88908
Node: Shell Builtin Commands91419
Node: Bourne Shell Builtins92994
Node: Bash Builtins109942
Node: The Set Builtin138064
Node: Special Builtins146282
Node: Shell Variables147254
Node: Bourne Shell Variables147690
Node: Bash Variables149667
Node: Bash Features169378
Node: Invoking Bash170260
Node: Bash Startup Files176071
Node: Interactive Shells180941
Node: What is an Interactive Shell?181343
Node: Is this Shell Interactive?181978
Node: Interactive Shell Behavior182784
Node: Bash Conditional Expressions186051
Node: Shell Arithmetic189471
Node: Aliases192211
Node: Arrays194774
Node: The Directory Stack197794
Node: Directory Stack Builtins198500
Node: Printing a Prompt201379
Node: The Restricted Shell204088
Node: Bash POSIX Mode205913
Node: Job Control212559
Node: Job Control Basics213025
Node: Job Control Builtins217310
Node: Job Control Variables221622
Node: Command Line Editing222772
Node: Introduction and Notation223770
Node: Readline Interaction225387
Node: Readline Bare Essentials226573
Node: Readline Movement Commands228353
Node: Readline Killing Commands229309
Node: Readline Arguments231218
Node: Searching232253
Node: Readline Init File234430
Node: Readline Init File Syntax235484
Node: Conditional Init Constructs247128
Node: Sample Init File249652
Node: Bindable Readline Commands252835
Node: Commands For Moving254034
Node: Commands For History254883
Node: Commands For Text257772
Node: Commands For Killing260433
Node: Numeric Arguments262563
Node: Commands For Completion263690
Node: Keyboard Macros267271
Node: Miscellaneous Commands267830
Node: Readline vi Mode273129
Node: Programmable Completion274038
Node: Programmable Completion Builtins279845
Node: Using History Interactively287207
Node: Bash History Facilities287886
Node: Bash History Builtins290576
Node: History Interaction294428
Node: Event Designators296979
Node: Word Designators297983
Node: Modifiers299613
Node: Installing Bash301010
Node: Basic Installation302144
Node: Compilers and Options304829
Node: Compiling For Multiple Architectures305563
Node: Installation Names307220
Node: Specifying the System Type308031
Node: Sharing Defaults308740
Node: Operation Controls309405
Node: Optional Features310356
Node: Reporting Bugs318628
Node: Major Differences From The Bourne Shell319803
Node: Copying This Manual335551
Node: GNU Free Documentation License335805
Node: Builtin Index358198
Node: Reserved Word Index361825
Node: Variable Index363301
Node: Function Index370351
Node: Concept Index374964
Node: Conditional Constructs27208
Node: Command Grouping34260
Node: Shell Functions35696
Node: Shell Parameters39958
Node: Positional Parameters41529
Node: Special Parameters42420
Node: Shell Expansions45078
Node: Brace Expansion46998
Node: Tilde Expansion49314
Node: Shell Parameter Expansion51645
Node: Command Substitution58898
Node: Arithmetic Expansion60220
Node: Process Substitution61061
Node: Word Splitting62098
Node: Filename Expansion63550
Node: Pattern Matching65674
Node: Quote Removal68995
Node: Redirections69281
Node: Executing Commands76755
Node: Simple Command Expansion77422
Node: Command Search and Execution79343
Node: Command Execution Environment81340
Node: Environment84102
Node: Exit Status85753
Node: Signals86948
Node: Shell Scripts88903
Node: Shell Builtin Commands91414
Node: Bourne Shell Builtins92989
Node: Bash Builtins109937
Node: The Set Builtin138054
Node: Special Builtins146272
Node: Shell Variables147244
Node: Bourne Shell Variables147680
Node: Bash Variables149656
Node: Bash Features169365
Node: Invoking Bash170247
Node: Bash Startup Files176056
Node: Interactive Shells180926
Node: What is an Interactive Shell?181328
Node: Is this Shell Interactive?181969
Node: Interactive Shell Behavior182775
Node: Bash Conditional Expressions186042
Node: Shell Arithmetic189461
Node: Aliases192201
Node: Arrays194764
Node: The Directory Stack197784
Node: Directory Stack Builtins198490
Node: Printing a Prompt201368
Node: The Restricted Shell204077
Node: Bash POSIX Mode205902
Node: Job Control212548
Node: Job Control Basics213014
Node: Job Control Builtins217299
Node: Job Control Variables221610
Node: Command Line Editing222759
Node: Introduction and Notation223757
Node: Readline Interaction225374
Node: Readline Bare Essentials226560
Node: Readline Movement Commands228340
Node: Readline Killing Commands229296
Node: Readline Arguments231204
Node: Searching232239
Node: Readline Init File234416
Node: Readline Init File Syntax235470
Node: Conditional Init Constructs247111
Node: Sample Init File249635
Node: Bindable Readline Commands252818
Node: Commands For Moving254017
Node: Commands For History254865
Node: Commands For Text257753
Node: Commands For Killing260413
Node: Numeric Arguments262543
Node: Commands For Completion263670
Node: Keyboard Macros267250
Node: Miscellaneous Commands267808
Node: Readline vi Mode273106
Node: Programmable Completion274015
Node: Programmable Completion Builtins279822
Node: Using History Interactively287183
Node: Bash History Facilities287862
Node: Bash History Builtins290552
Node: History Interaction294402
Node: Event Designators296953
Node: Word Designators297956
Node: Modifiers299585
Node: Installing Bash300981
Node: Basic Installation302115
Node: Compilers and Options304800
Node: Compiling For Multiple Architectures305534
Node: Installation Names307191
Node: Specifying the System Type308002
Node: Sharing Defaults308711
Node: Operation Controls309376
Node: Optional Features310327
Node: Reporting Bugs318598
Node: Major Differences From The Bourne Shell319773
Node: Copying This Manual335521
Node: GNU Free Documentation License335775
Node: Builtin Index358168
Node: Reserved Word Index361795
Node: Variable Index363271
Node: Function Index370321
Node: Concept Index374934

End Tag Table
-1
View File
@@ -1 +0,0 @@
texinfo.tex.20030205
+6688
View File
File diff suppressed because it is too large Load Diff
+9
View File
@@ -102,6 +102,7 @@ extern int parse_and_execute_level, running_trap;
extern int command_string_index, line_number;
extern int dot_found_in_search;
extern int already_making_children;
extern int tempenv_assign_error;
extern char *the_printed_command, *shell_name;
extern pid_t last_command_subst_pid;
extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin;
@@ -2842,6 +2843,14 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
func = find_function (words->word->word);
}
/* In POSIX mode, assignment errors in the temporary environment cause a
non-interactive shell to exit. */
if (builtin_is_special && interactive_shell == 0 && tempenv_assign_error)
{
last_command_exit_value = EXECUTION_FAILURE;
jump_to_top_level (ERREXIT);
}
add_unwind_protect (dispose_words, words);
QUIT;
+8 -4
View File
@@ -526,8 +526,6 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
{
pid_t paren_pid;
if (asynchronous)
itrace("execute_command_internal: making child: asynchronous = 1 job_control = %d", job_control);
/* Fork a subshell, turn off the subshell bit, turn off job
control and call execute_command () on the command again. */
paren_pid = make_child (savestring (make_command_string (command)),
@@ -1185,8 +1183,6 @@ execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)
command->flags &= ~(CMD_FORCE_SUBSHELL | CMD_WANT_SUBSHELL | CMD_INVERT_RETURN);
itrace("execute_in_subshell: job_control = %d user_subshell = %d", job_control, user_subshell);
/* If a command is asynchronous in a subshell (like ( foo ) & or
the special case of an asynchronous GROUP command where the
the subshell bit is turned on down in case cm_group: below),
@@ -2846,6 +2842,14 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
func = find_function (words->word->word);
}
/* In POSIX mode, assignment errors in the temporary environment cause a
non-interactive shell to exit. */
if (builtin_is_special && interactive_shell == 0 && tempenv_assign_error)
{
last_command_exit_value = EXECUTION_FAILURE;
jump_to_top_level (ERREXIT);
}
add_unwind_protect (dispose_words, words);
QUIT;
-1
View File
@@ -1 +0,0 @@
../../include/ansi_stdlib.h
+54
View File
@@ -0,0 +1,54 @@
/* ansi_stdlib.h -- An ANSI Standard stdlib.h. */
/* A minimal stdlib.h containing extern declarations for those functions
that bash uses. */
/* Copyright (C) 1993 Free Software Foundation, Inc.
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 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_STDLIB_H_)
#define _STDLIB_H_ 1
/* String conversion functions. */
extern int atoi ();
extern double atof ();
extern double strtod ();
/* Memory allocation functions. */
/* Generic pointer type. */
#ifndef PTR_T
#if defined (__STDC__)
# define PTR_T void *
#else
# define PTR_T char *
#endif
#endif /* PTR_T */
extern PTR_T malloc ();
extern PTR_T realloc ();
extern void free ();
/* Other miscellaneous functions. */
extern void abort ();
extern void exit ();
extern char *getenv ();
extern void qsort ();
#endif /* _STDLIB_H */
+2 -1
View File
@@ -685,6 +685,7 @@ print_filename (to_print, full_pathname)
int printed_len, extension_char, slen, tlen;
char *s, c, *new_full_pathname;
extension_char = 0;
printed_len = fnprint (to_print);
#if defined (VISIBLE_STATS)
@@ -737,7 +738,7 @@ print_filename (to_print, full_pathname)
extension_char = stat_char (s);
else
#endif
if (path_isdir (new_full_pathname))
if (path_isdir (s))
extension_char = '/';
}
File diff suppressed because it is too large Load Diff
-1
View File
@@ -1 +0,0 @@
../../../doc/fdl.texi
+452
View File
@@ -0,0 +1,452 @@
@node GNU Free Documentation License
@appendixsec GNU Free Documentation License
@cindex FDL, GNU Free Documentation License
@center Version 1.2, November 2002
@display
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document @dfn{free} in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
@item
APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The ``Document'', below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as ``you''. You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A ``Secondary Section'' is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject. (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
@sc{ascii} without markup, Texinfo input format, La@TeX{} input
format, @acronym{SGML} or @acronym{XML} using a publicly available
@acronym{DTD}, and standard-conforming simple @acronym{HTML},
PostScript or @acronym{PDF} designed for human modification. Examples
of transparent image formats include @acronym{PNG}, @acronym{XCF} and
@acronym{JPG}. Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, @acronym{SGML} or
@acronym{XML} for which the @acronym{DTD} and/or processing tools are
not generally available, and the machine-generated @acronym{HTML},
PostScript or @acronym{PDF} produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as ``Acknowledgements'',
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
@item
VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
@item
COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
@item
MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
@enumerate A
@item
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
@item
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
@item
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
@item
Preserve all the copyright notices of the Document.
@item
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
@item
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
@item
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
@item
Include an unaltered copy of this License.
@item
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
@item
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@item
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
Do not retitle any existing section to be Entitled ``Endorsements'' or
to conflict in title with any Invariant Section.
@item
Preserve any Warranty Disclaimers.
@end enumerate
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
@item
COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled ``History''
in the various original documents, forming one section Entitled
``History''; likewise combine any sections Entitled ``Acknowledgements'',
and any sections Entitled ``Dedications''. You must delete all
sections Entitled ``Endorsements.''
@item
COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
@item
TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
@item
TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
@item
FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
@uref{http://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
@end enumerate
@page
@appendixsubsec ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
@smallexample
@group
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the ``with...Texts.'' line with this:
@smallexample
@group
with the Invariant Sections being @var{list their titles}, with
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
being @var{list}.
@end group
@end smallexample
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:
-1
View File
@@ -1 +0,0 @@
../../include/posixdir.h
+61
View File
@@ -0,0 +1,61 @@
/* posixdir.h -- Posix directory reading includes and defines. */
/* Copyright (C) 1987,1991 Free Software Foundation, Inc.
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 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License 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, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
/* This file should be included instead of <dirent.h> or <sys/dir.h>. */
#if !defined (_POSIXDIR_H_)
#define _POSIXDIR_H_
#if defined (HAVE_DIRENT_H)
# include <dirent.h>
# if defined (HAVE_STRUCT_DIRENT_D_NAMLEN)
# define D_NAMLEN(d) ((d)->d_namlen)
# else
# define D_NAMLEN(d) (strlen ((d)->d_name))
# endif /* !HAVE_STRUCT_DIRENT_D_NAMLEN */
#else
# if defined (HAVE_SYS_NDIR_H)
# include <sys/ndir.h>
# endif
# if defined (HAVE_SYS_DIR_H)
# include <sys/dir.h>
# endif
# if defined (HAVE_NDIR_H)
# include <ndir.h>
# endif
# if !defined (dirent)
# define dirent direct
# endif /* !dirent */
# define D_NAMLEN(d) ((d)->d_namlen)
#endif /* !HAVE_DIRENT_H */
#if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (HAVE_STRUCT_DIRENT_D_FILENO)
# define d_fileno d_ino
#endif
#if defined (_POSIX_SOURCE) && (!defined (HAVE_STRUCT_DIRENT_D_INO) || defined (BROKEN_DIRENT_D_INO))
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
# define REAL_DIR_ENTRY(dp) 1
#else
# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
#endif /* _POSIX_SOURCE */
#endif /* !_POSIXDIR_H_ */
-1
View File
@@ -1 +0,0 @@
../../include/posixjmp.h
+40
View File
@@ -0,0 +1,40 @@
/* posixjmp.h -- wrapper for setjmp.h with changes for POSIX systems. */
/* Copyright (C) 1987,1991 Free Software Foundation, Inc.
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 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License 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, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#ifndef _POSIXJMP_H_
#define _POSIXJMP_H_
#include <setjmp.h>
/* This *must* be included *after* config.h */
#if defined (HAVE_POSIX_SIGSETJMP)
# define procenv_t sigjmp_buf
# if !defined (__OPENNT)
# undef setjmp
# define setjmp(x) sigsetjmp((x), 1)
# undef longjmp
# define longjmp(x, n) siglongjmp((x), (n))
# endif /* !__OPENNT */
#else
# define procenv_t jmp_buf
#endif
#endif /* _POSIXJMP_H_ */
-1
View File
@@ -1 +0,0 @@
../../include/posixstat.h
+142
View File
@@ -0,0 +1,142 @@
/* posixstat.h -- Posix stat(2) definitions for systems that
don't have them. */
/* Copyright (C) 1987,1991 Free Software Foundation, Inc.
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 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License 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, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
/* This file should be included instead of <sys/stat.h>.
It relies on the local sys/stat.h to work though. */
#if !defined (_POSIXSTAT_H_)
#define _POSIXSTAT_H_
#include <sys/stat.h>
#if defined (STAT_MACROS_BROKEN)
# undef S_ISBLK
# undef S_ISCHR
# undef S_ISDIR
# undef S_ISFIFO
# undef S_ISREG
# undef S_ISLNK
#endif /* STAT_MACROS_BROKEN */
/* These are guaranteed to work only on isc386 */
#if !defined (S_IFDIR) && !defined (S_ISDIR)
# define S_IFDIR 0040000
#endif /* !S_IFDIR && !S_ISDIR */
#if !defined (S_IFMT)
# define S_IFMT 0170000
#endif /* !S_IFMT */
/* Posix 1003.1 5.6.1.1 <sys/stat.h> file types */
/* Some Posix-wannabe systems define _S_IF* macros instead of S_IF*, but
do not provide the S_IS* macros that Posix requires. */
#if defined (_S_IFMT) && !defined (S_IFMT)
#define S_IFMT _S_IFMT
#endif
#if defined (_S_IFIFO) && !defined (S_IFIFO)
#define S_IFIFO _S_IFIFO
#endif
#if defined (_S_IFCHR) && !defined (S_IFCHR)
#define S_IFCHR _S_IFCHR
#endif
#if defined (_S_IFDIR) && !defined (S_IFDIR)
#define S_IFDIR _S_IFDIR
#endif
#if defined (_S_IFBLK) && !defined (S_IFBLK)
#define S_IFBLK _S_IFBLK
#endif
#if defined (_S_IFREG) && !defined (S_IFREG)
#define S_IFREG _S_IFREG
#endif
#if defined (_S_IFLNK) && !defined (S_IFLNK)
#define S_IFLNK _S_IFLNK
#endif
#if defined (_S_IFSOCK) && !defined (S_IFSOCK)
#define S_IFSOCK _S_IFSOCK
#endif
/* Test for each symbol individually and define the ones necessary (some
systems claiming Posix compatibility define some but not all). */
#if defined (S_IFBLK) && !defined (S_ISBLK)
#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) /* block device */
#endif
#if defined (S_IFCHR) && !defined (S_ISCHR)
#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) /* character device */
#endif
#if defined (S_IFDIR) && !defined (S_ISDIR)
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) /* directory */
#endif
#if defined (S_IFREG) && !defined (S_ISREG)
#define S_ISREG(m) (((m)&S_IFMT) == S_IFREG) /* file */
#endif
#if defined (S_IFIFO) && !defined (S_ISFIFO)
#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO) /* fifo - named pipe */
#endif
#if defined (S_IFLNK) && !defined (S_ISLNK)
#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK) /* symbolic link */
#endif
#if defined (S_IFSOCK) && !defined (S_ISSOCK)
#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK) /* socket */
#endif
/*
* POSIX 1003.1 5.6.1.2 <sys/stat.h> File Modes
*/
#if !defined (S_IRWXU)
# if !defined (S_IREAD)
# define S_IREAD 00400
# define S_IWRITE 00200
# define S_IEXEC 00100
# endif /* S_IREAD */
# if !defined (S_IRUSR)
# define S_IRUSR S_IREAD /* read, owner */
# define S_IWUSR S_IWRITE /* write, owner */
# define S_IXUSR S_IEXEC /* execute, owner */
# define S_IRGRP (S_IREAD >> 3) /* read, group */
# define S_IWGRP (S_IWRITE >> 3) /* write, group */
# define S_IXGRP (S_IEXEC >> 3) /* execute, group */
# define S_IROTH (S_IREAD >> 6) /* read, other */
# define S_IWOTH (S_IWRITE >> 6) /* write, other */
# define S_IXOTH (S_IEXEC >> 6) /* execute, other */
# endif /* !S_IRUSR */
# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
#endif /* !S_IRWXU */
/* These are non-standard, but are used in builtins.c$symbolic_umask() */
#define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH)
#define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH)
#define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
#endif /* _POSIXSTAT_H_ */
-1
View File
@@ -1 +0,0 @@
../tilde/tilde.c
+458
View File
@@ -0,0 +1,458 @@
/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). */
/* Copyright (C) 1988,1989 Free Software Foundation, Inc.
This file is part of GNU Readline, a library for reading lines
of text with interactive input and history editing.
Readline 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 2, or (at your option) any
later version.
Readline is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with Readline; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#if defined (HAVE_UNISTD_H)
# ifdef _MINIX
# include <sys/types.h>
# endif
# include <unistd.h>
#endif
#if defined (HAVE_STRING_H)
# include <string.h>
#else /* !HAVE_STRING_H */
# include <strings.h>
#endif /* !HAVE_STRING_H */
#if defined (HAVE_STDLIB_H)
# include <stdlib.h>
#else
# include "ansi_stdlib.h"
#endif /* HAVE_STDLIB_H */
#include <sys/types.h>
#include <pwd.h>
#include "tilde.h"
#if defined (TEST) || defined (STATIC_MALLOC)
static void *xmalloc (), *xrealloc ();
#else
# include "xmalloc.h"
#endif /* TEST || STATIC_MALLOC */
#if !defined (HAVE_GETPW_DECLS)
extern struct passwd *getpwuid PARAMS((uid_t));
extern struct passwd *getpwnam PARAMS((const char *));
#endif /* !HAVE_GETPW_DECLS */
#if !defined (savestring)
#define savestring(x) strcpy ((char *)xmalloc (1 + strlen (x)), (x))
#endif /* !savestring */
#if !defined (NULL)
# if defined (__STDC__)
# define NULL ((void *) 0)
# else
# define NULL 0x0
# endif /* !__STDC__ */
#endif /* !NULL */
/* If being compiled as part of bash, these will be satisfied from
variables.o. If being compiled as part of readline, they will
be satisfied from shell.o. */
extern char *sh_get_home_dir PARAMS((void));
extern char *sh_get_env_value PARAMS((const char *));
/* The default value of tilde_additional_prefixes. This is set to
whitespace preceding a tilde so that simple programs which do not
perform any word separation get desired behaviour. */
static const char *default_prefixes[] =
{ " ~", "\t~", (const char *)NULL };
/* The default value of tilde_additional_suffixes. This is set to
whitespace or newline so that simple programs which do not
perform any word separation get desired behaviour. */
static const char *default_suffixes[] =
{ " ", "\n", (const char *)NULL };
/* If non-null, this contains the address of a function that the application
wants called before trying the standard tilde expansions. The function
is called with the text sans tilde, and returns a malloc()'ed string
which is the expansion, or a NULL pointer if the expansion fails. */
tilde_hook_func_t *tilde_expansion_preexpansion_hook = (tilde_hook_func_t *)NULL;
/* If non-null, this contains the address of a function to call if the
standard meaning for expanding a tilde fails. The function is called
with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
which is the expansion, or a NULL pointer if there is no expansion. */
tilde_hook_func_t *tilde_expansion_failure_hook = (tilde_hook_func_t *)NULL;
/* When non-null, this is a NULL terminated array of strings which
are duplicates for a tilde prefix. Bash uses this to expand
`=~' and `:~'. */
char **tilde_additional_prefixes = (char **)default_prefixes;
/* When non-null, this is a NULL terminated array of strings which match
the end of a username, instead of just "/". Bash sets this to
`:' and `=~'. */
char **tilde_additional_suffixes = (char **)default_suffixes;
static int tilde_find_prefix PARAMS((const char *, int *));
static int tilde_find_suffix PARAMS((const char *));
static char *isolate_tilde_prefix PARAMS((const char *, int *));
static char *glue_prefix_and_suffix PARAMS((char *, const char *, int));
/* Find the start of a tilde expansion in STRING, and return the index of
the tilde which starts the expansion. Place the length of the text
which identified this tilde starter in LEN, excluding the tilde itself. */
static int
tilde_find_prefix (string, len)
const char *string;
int *len;
{
register int i, j, string_len;
register char **prefixes;
prefixes = tilde_additional_prefixes;
string_len = strlen (string);
*len = 0;
if (*string == '\0' || *string == '~')
return (0);
if (prefixes)
{
for (i = 0; i < string_len; i++)
{
for (j = 0; prefixes[j]; j++)
{
if (strncmp (string + i, prefixes[j], strlen (prefixes[j])) == 0)
{
*len = strlen (prefixes[j]) - 1;
return (i + *len);
}
}
}
}
return (string_len);
}
/* Find the end of a tilde expansion in STRING, and return the index of
the character which ends the tilde definition. */
static int
tilde_find_suffix (string)
const char *string;
{
register int i, j, string_len;
register char **suffixes;
suffixes = tilde_additional_suffixes;
string_len = strlen (string);
for (i = 0; i < string_len; i++)
{
#if defined (__MSDOS__)
if (string[i] == '/' || string[i] == '\\' /* || !string[i] */)
#else
if (string[i] == '/' /* || !string[i] */)
#endif
break;
for (j = 0; suffixes && suffixes[j]; j++)
{
if (strncmp (string + i, suffixes[j], strlen (suffixes[j])) == 0)
return (i);
}
}
return (i);
}
/* Return a new string which is the result of tilde expanding STRING. */
char *
tilde_expand (string)
const char *string;
{
char *result;
int result_size, result_index;
result_index = result_size = 0;
if (result = strchr (string, '~'))
result = (char *)xmalloc (result_size = (strlen (string) + 16));
else
result = (char *)xmalloc (result_size = (strlen (string) + 1));
/* Scan through STRING expanding tildes as we come to them. */
while (1)
{
register int start, end;
char *tilde_word, *expansion;
int len;
/* Make START point to the tilde which starts the expansion. */
start = tilde_find_prefix (string, &len);
/* Copy the skipped text into the result. */
if ((result_index + start + 1) > result_size)
result = (char *)xrealloc (result, 1 + (result_size += (start + 20)));
strncpy (result + result_index, string, start);
result_index += start;
/* Advance STRING to the starting tilde. */
string += start;
/* Make END be the index of one after the last character of the
username. */
end = tilde_find_suffix (string);
/* If both START and END are zero, we are all done. */
if (!start && !end)
break;
/* Expand the entire tilde word, and copy it into RESULT. */
tilde_word = (char *)xmalloc (1 + end);
strncpy (tilde_word, string, end);
tilde_word[end] = '\0';
string += end;
expansion = tilde_expand_word (tilde_word);
free (tilde_word);
len = strlen (expansion);
#ifdef __CYGWIN__
/* Fix for Cygwin to prevent ~user/xxx from expanding to //xxx when
$HOME for `user' is /. On cygwin, // denotes a network drive. */
if (len > 1 || *expansion != '/' || *string != '/')
#endif
{
if ((result_index + len + 1) > result_size)
result = (char *)xrealloc (result, 1 + (result_size += (len + 20)));
strcpy (result + result_index, expansion);
result_index += len;
}
free (expansion);
}
result[result_index] = '\0';
return (result);
}
/* Take FNAME and return the tilde prefix we want expanded. If LENP is
non-null, the index of the end of the prefix into FNAME is returned in
the location it points to. */
static char *
isolate_tilde_prefix (fname, lenp)
const char *fname;
int *lenp;
{
char *ret;
int i;
ret = (char *)xmalloc (strlen (fname));
#if defined (__MSDOS__)
for (i = 1; fname[i] && fname[i] != '/' && fname[i] != '\\'; i++)
#else
for (i = 1; fname[i] && fname[i] != '/'; i++)
#endif
ret[i - 1] = fname[i];
ret[i - 1] = '\0';
if (lenp)
*lenp = i;
return ret;
}
/* Return a string that is PREFIX concatenated with SUFFIX starting at
SUFFIND. */
static char *
glue_prefix_and_suffix (prefix, suffix, suffind)
char *prefix;
const char *suffix;
int suffind;
{
char *ret;
int plen, slen;
plen = (prefix && *prefix) ? strlen (prefix) : 0;
slen = strlen (suffix + suffind);
ret = (char *)xmalloc (plen + slen + 1);
if (plen)
strcpy (ret, prefix);
strcpy (ret + plen, suffix + suffind);
return ret;
}
/* Do the work of tilde expansion on FILENAME. FILENAME starts with a
tilde. If there is no expansion, call tilde_expansion_failure_hook.
This always returns a newly-allocated string, never static storage. */
char *
tilde_expand_word (filename)
const char *filename;
{
char *dirname, *expansion, *username;
int user_len;
struct passwd *user_entry;
if (filename == 0)
return ((char *)NULL);
if (*filename != '~')
return (savestring (filename));
/* A leading `~/' or a bare `~' is *always* translated to the value of
$HOME or the home directory of the current user, regardless of any
preexpansion hook. */
if (filename[1] == '\0' || filename[1] == '/')
{
/* Prefix $HOME to the rest of the string. */
expansion = sh_get_env_value ("HOME");
/* If there is no HOME variable, look up the directory in
the password database. */
if (expansion == 0)
expansion = sh_get_home_dir ();
return (glue_prefix_and_suffix (expansion, filename, 1));
}
username = isolate_tilde_prefix (filename, &user_len);
if (tilde_expansion_preexpansion_hook)
{
expansion = (*tilde_expansion_preexpansion_hook) (username);
if (expansion)
{
dirname = glue_prefix_and_suffix (expansion, filename, user_len);
free (username);
free (expansion);
return (dirname);
}
}
/* No preexpansion hook, or the preexpansion hook failed. Look in the
password database. */
dirname = (char *)NULL;
user_entry = getpwnam (username);
if (user_entry == 0)
{
/* If the calling program has a special syntax for expanding tildes,
and we couldn't find a standard expansion, then let them try. */
if (tilde_expansion_failure_hook)
{
expansion = (*tilde_expansion_failure_hook) (username);
if (expansion)
{
dirname = glue_prefix_and_suffix (expansion, filename, user_len);
free (expansion);
}
}
free (username);
/* If we don't have a failure hook, or if the failure hook did not
expand the tilde, return a copy of what we were passed. */
if (dirname == 0)
dirname = savestring (filename);
}
else
{
free (username);
dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len);
}
endpwent ();
return (dirname);
}
#if defined (TEST)
#undef NULL
#include <stdio.h>
main (argc, argv)
int argc;
char **argv;
{
char *result, line[512];
int done = 0;
while (!done)
{
printf ("~expand: ");
fflush (stdout);
if (!gets (line))
strcpy (line, "done");
if ((strcmp (line, "done") == 0) ||
(strcmp (line, "quit") == 0) ||
(strcmp (line, "exit") == 0))
{
done = 1;
break;
}
result = tilde_expand (line);
printf (" --> %s\n", result);
free (result);
}
exit (0);
}
static void memory_error_and_abort ();
static void *
xmalloc (bytes)
size_t bytes;
{
void *temp = (char *)malloc (bytes);
if (!temp)
memory_error_and_abort ();
return (temp);
}
static void *
xrealloc (pointer, bytes)
void *pointer;
int bytes;
{
void *temp;
if (!pointer)
temp = malloc (bytes);
else
temp = realloc (pointer, bytes);
if (!temp)
memory_error_and_abort ();
return (temp);
}
static void
memory_error_and_abort ()
{
fprintf (stderr, "readline: out of virtual memory\n");
abort ();
}
/*
* Local variables:
* compile-command: "gcc -g -DTEST -o tilde tilde.c"
* end:
*/
#endif /* TEST */
-1
View File
@@ -1 +0,0 @@
../tilde/tilde.h
+78
View File
@@ -0,0 +1,78 @@
/* tilde.h: Externally available variables and function in libtilde.a. */
/* Copyright (C) 1992 Free Software Foundation, Inc.
This file contains the Readline Library (the Library), a set of
routines for providing Emacs style line input to programs that ask
for it.
The Library 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 2, or (at your option)
any later version.
The Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_TILDE_H_)
# define _TILDE_H_
#ifdef __cplusplus
extern "C" {
#endif
/* A function can be defined using prototypes and compile on both ANSI C
and traditional C compilers with something like this:
extern char *func PARAMS((char *, char *, int)); */
#if !defined (PARAMS)
# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus)
# define PARAMS(protos) protos
# else
# define PARAMS(protos) ()
# endif
#endif
typedef char *tilde_hook_func_t PARAMS((char *));
/* If non-null, this contains the address of a function that the application
wants called before trying the standard tilde expansions. The function
is called with the text sans tilde, and returns a malloc()'ed string
which is the expansion, or a NULL pointer if the expansion fails. */
extern tilde_hook_func_t *tilde_expansion_preexpansion_hook;
/* If non-null, this contains the address of a function to call if the
standard meaning for expanding a tilde fails. The function is called
with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
which is the expansion, or a NULL pointer if there is no expansion. */
extern tilde_hook_func_t *tilde_expansion_failure_hook;
/* When non-null, this is a NULL terminated array of strings which
are duplicates for a tilde prefix. Bash uses this to expand
`=~' and `:~'. */
extern char **tilde_additional_prefixes;
/* When non-null, this is a NULL terminated array of strings which match
the end of a username, instead of just "/". Bash sets this to
`:' and `=~'. */
extern char **tilde_additional_suffixes;
/* Return a new string which is the result of tilde expanding STRING. */
extern char *tilde_expand PARAMS((const char *));
/* Do the work of tilde expansion on FILENAME. FILENAME starts with a
tilde. If there is no expansion, call tilde_expansion_failure_hook. */
extern char *tilde_expand_word PARAMS((const char *));
#ifdef __cplusplus
}
#endif
#endif /* _TILDE_H_ */
+52
View File
@@ -0,0 +1,52 @@
typedef union {
WORD_DESC *word; /* the word that we read. */
int number; /* the number that we read. */
WORD_LIST *word_list;
COMMAND *command;
REDIRECT *redirect;
ELEMENT element;
PATTERN_LIST *pattern;
} YYSTYPE;
#define IF 257
#define THEN 258
#define ELSE 259
#define ELIF 260
#define FI 261
#define CASE 262
#define ESAC 263
#define FOR 264
#define SELECT 265
#define WHILE 266
#define UNTIL 267
#define DO 268
#define DONE 269
#define FUNCTION 270
#define COND_START 271
#define COND_END 272
#define COND_ERROR 273
#define IN 274
#define BANG 275
#define TIME 276
#define TIMEOPT 277
#define WORD 278
#define ASSIGNMENT_WORD 279
#define NUMBER 280
#define ARITH_CMD 281
#define ARITH_FOR_EXPRS 282
#define COND_CMD 283
#define AND_AND 284
#define OR_OR 285
#define GREATER_GREATER 286
#define LESS_LESS 287
#define LESS_AND 288
#define LESS_LESS_LESS 289
#define GREATER_AND 290
#define SEMI_SEMI 291
#define LESS_LESS_MINUS 292
#define AND_GREATER 293
#define LESS_GREATER 294
#define GREATER_BAR 295
#define yacc_EOF 296
extern YYSTYPE yylval;
+1 -1
View File
@@ -16,4 +16,4 @@ $(srcdir)/builtins.pot:
$(MAKE) builtins.pot-update
xdist:
update-po
$(MAKE) update-po
Binary file not shown.
+7 -7
View File
@@ -1,7 +1,7 @@
# English translations for GNU bash package.
# Copyright (C) 2003 Free Software Foundation, Inc.
# Copyright (C) 2004 Free Software Foundation, Inc.
# This file is distributed under the same license as the GNU bash package.
# Automatically generated, 2003.
# Automatically generated, 2004.
#
# All this catalog "translates" are quotation characters.
# The msgids must be ASCII and therefore cannot contain real quotation
@@ -48,7 +48,7 @@
#: builtins.c:1362 builtins.c:1365
msgid ""
msgstr ""
"Project-Id-Version: GNU bash 3.0-alpha\n"
"Project-Id-Version: GNU bash 3.0-rc1\n"
"POT-Creation-Date: 2003-12-22 15:34-0500\n"
"PO-Revision-Date: 2003-12-22 15:34-0500\n"
"Last-Translator: Automatically generated\n"
@@ -93,9 +93,9 @@ msgid "%s: missing colon separator"
msgstr "%s: missing colon separator"
#: builtins/alias.def:123
#, fuzzy, c-format
#, c-format
msgid "`%s': invalid alias name"
msgstr "%s: invalid keymap name"
msgstr "%s: invalid alias name"
#: builtins/bind.def:194
#, c-format
@@ -265,9 +265,9 @@ msgid "%s: not a shell builtin"
msgstr "%s: not a shell builtin"
#: builtins/common.c:486
#, fuzzy, c-format
#, c-format
msgid "%s: error retrieving current directory: %s: %s\n"
msgstr "%s: could not get current directory: %s: %s\n"
msgstr "%s: error retrieving current directory: %s: %s\n"
#: builtins/common.c:553 builtins/common.c:555
#, c-format
BIN
View File
Binary file not shown.
+7 -7
View File
@@ -1,7 +1,7 @@
# English translations for GNU bash package.
# Copyright (C) 2003 Free Software Foundation, Inc.
# Copyright (C) 2004 Free Software Foundation, Inc.
# This file is distributed under the same license as the GNU bash package.
# Automatically generated, 2003.
# Automatically generated, 2004.
#
# All this catalog "translates" are quotation characters.
# The msgids must be ASCII and therefore cannot contain real quotation
@@ -45,7 +45,7 @@
#: builtins.c:1362 builtins.c:1365
msgid ""
msgstr ""
"Project-Id-Version: GNU bash 3.0-alpha\n"
"Project-Id-Version: GNU bash 3.0-rc1\n"
"POT-Creation-Date: 2003-12-22 15:34-0500\n"
"PO-Revision-Date: 2003-12-22 15:34-0500\n"
"Last-Translator: Automatically generated\n"
@@ -90,9 +90,9 @@ msgid "%s: missing colon separator"
msgstr "%s: missing colon separator"
#: builtins/alias.def:123
#, fuzzy, c-format
#, c-format
msgid "`%s': invalid alias name"
msgstr "%s: invalid keymap name"
msgstr "%s: invalid alias name"
#: builtins/bind.def:194
#, c-format
@@ -262,9 +262,9 @@ msgid "%s: not a shell builtin"
msgstr "%s: not a shell builtin"
#: builtins/common.c:486
#, fuzzy, c-format
#, c-format
msgid "%s: error retrieving current directory: %s: %s\n"
msgstr "%s: could not get current directory: %s: %s\n"
msgstr "%s: error retrieving current directory: %s: %s\n"
#: builtins/common.c:553 builtins/common.c:555
#, c-format
+21 -7
View File
@@ -138,6 +138,7 @@ extern char *this_command_name;
extern struct fd_bitmap *current_fds_to_close;
extern int wordexp_only;
extern int expanding_redir;
extern int tempenv_assign_error;
/* Non-zero means to allow unmatched globbed filenames to expand to
a null file. */
@@ -699,9 +700,16 @@ add_one_character:
for (t = 0; ret[t]; t++, j++)
temp[j] = ret[t];
temp[j++] = string[si];
temp[j] = string[si];
if (string[si])
{
j++;
i = si + 1;
}
else
i = si;
i = si + 1;
if (free_ret)
free (ret);
continue;
@@ -7343,6 +7351,7 @@ expand_word_list_internal (list, eflags)
that the variable and environment assignments affect the shell's
environment. */
assign_func = new_list ? assign_in_env : do_assignment;
tempenv_assign_error = 0;
for (temp_list = subst_assign_varlist; temp_list; temp_list = temp_list->next)
{
@@ -7350,13 +7359,18 @@ expand_word_list_internal (list, eflags)
tint = (*assign_func) (temp_list->word->word);
/* Variable assignment errors in non-interactive shells running
in Posix.2 mode cause the shell to exit. */
if (tint == 0 && assign_func == do_assignment)
if (tint == 0)
{
last_command_exit_value = EXECUTION_FAILURE;
if (interactive_shell == 0 && posixly_correct)
exp_jump_to_top_level (FORCE_EOF);
if (assign_func == do_assignment)
{
last_command_exit_value = EXECUTION_FAILURE;
if (interactive_shell == 0 && posixly_correct)
exp_jump_to_top_level (FORCE_EOF);
else
exp_jump_to_top_level (DISCARD);
}
else
exp_jump_to_top_level (DISCARD);
tempenv_assign_error++;
}
}
+11 -2
View File
@@ -689,6 +689,8 @@ add_one_character:
temp[j++] = '$';
temp[j++] = string[i + 1];
/* Just paranoia; ret will not be 0 unless no_longjmp_on_fatal_error
is set. */
if (ret == 0 && no_longjmp_on_fatal_error)
{
free_ret = 0;
@@ -697,9 +699,16 @@ add_one_character:
for (t = 0; ret[t]; t++, j++)
temp[j] = ret[t];
temp[j++] = string[si];
temp[j] = string[si];
if (string[si])
{
j++;
i = si + 1;
}
else
i = si;
i = si + 1;
if (free_ret)
free (ret);
continue;
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
+2
View File
@@ -1,2 +1,4 @@
echo "warning: different versions of wc put differing amounts of whitespace" >&2
echo "warning: before their output. Please do not consider this an error." >&2
${THIS_SH} ./read.tests > /tmp/xx 2>&1
diff /tmp/xx read.right && rm -f /tmp/xx
+4
View File
@@ -116,6 +116,10 @@ int variable_context = 0;
for a single command. */
HASH_TABLE *temporary_env = (HASH_TABLE *)NULL;
/* Set to non-zero if an assignment error occurs while putting variables
into the temporary environment. */
int tempenv_assign_error;
/* Some funky variables which are known about specially. Here is where
"$*", "$1", and all the cruft is kept. */
char *dollar_vars[10];
+9 -11
View File
@@ -116,6 +116,10 @@ int variable_context = 0;
for a single command. */
HASH_TABLE *temporary_env = (HASH_TABLE *)NULL;
/* Set to non-zero if an assignment error occurs while putting variables
into the temporary environment. */
int tempenv_assign_errors;
/* Some funky variables which are known about specially. Here is where
"$*", "$1", and all the cruft is kept. */
char *dollar_vars[10];
@@ -1663,8 +1667,9 @@ make_local_array_variable (name)
ARRAY *array;
var = make_local_variable (name);
if (var == 0)
if (var == 0 || array_p (var))
return var;
array = array_create ();
FREE (value_cell(var));
@@ -2118,16 +2123,9 @@ assign_in_env (string)
setifs (var);
if (echo_command_at_execute)
{
/* The Korn shell prints the `+ ' in front of assignment statements,
so we do too. */
#if 0
fprintf (stderr, "%s%s=%s\n", indirection_level_string (), name, value);
fflush (stderr);
#else
xtrace_print_assignment (name, value, 0, 1);
#endif
}
/* The Korn shell prints the `+ ' in front of assignment statements,
so we do too. */
xtrace_print_assignment (name, value, 0, 1);
free (name);
return 1;
+1296 -1437
View File
File diff suppressed because it is too large Load Diff
+41 -49
View File
@@ -1,7 +1,3 @@
#ifndef BISON_Y_TAB_H
# define BISON_Y_TAB_H
#ifndef YYSTYPE
typedef union {
WORD_DESC *word; /* the word that we read. */
int number; /* the number that we read. */
@@ -10,51 +6,47 @@ typedef union {
REDIRECT *redirect;
ELEMENT element;
PATTERN_LIST *pattern;
} yystype;
# define YYSTYPE yystype
#endif
# define IF 257
# define THEN 258
# define ELSE 259
# define ELIF 260
# define FI 261
# define CASE 262
# define ESAC 263
# define FOR 264
# define SELECT 265
# define WHILE 266
# define UNTIL 267
# define DO 268
# define DONE 269
# define FUNCTION 270
# define COND_START 271
# define COND_END 272
# define COND_ERROR 273
# define IN 274
# define BANG 275
# define TIME 276
# define TIMEOPT 277
# define WORD 278
# define ASSIGNMENT_WORD 279
# define NUMBER 280
# define ARITH_CMD 281
# define ARITH_FOR_EXPRS 282
# define COND_CMD 283
# define AND_AND 284
# define OR_OR 285
# define GREATER_GREATER 286
# define LESS_LESS 287
# define LESS_AND 288
# define LESS_LESS_LESS 289
# define GREATER_AND 290
# define SEMI_SEMI 291
# define LESS_LESS_MINUS 292
# define AND_GREATER 293
# define LESS_GREATER 294
# define GREATER_BAR 295
# define yacc_EOF 296
} YYSTYPE;
#define IF 257
#define THEN 258
#define ELSE 259
#define ELIF 260
#define FI 261
#define CASE 262
#define ESAC 263
#define FOR 264
#define SELECT 265
#define WHILE 266
#define UNTIL 267
#define DO 268
#define DONE 269
#define FUNCTION 270
#define COND_START 271
#define COND_END 272
#define COND_ERROR 273
#define IN 274
#define BANG 275
#define TIME 276
#define TIMEOPT 277
#define WORD 278
#define ASSIGNMENT_WORD 279
#define NUMBER 280
#define ARITH_CMD 281
#define ARITH_FOR_EXPRS 282
#define COND_CMD 283
#define AND_AND 284
#define OR_OR 285
#define GREATER_GREATER 286
#define LESS_LESS 287
#define LESS_AND 288
#define LESS_LESS_LESS 289
#define GREATER_AND 290
#define SEMI_SEMI 291
#define LESS_LESS_MINUS 292
#define AND_GREATER 293
#define LESS_GREATER 294
#define GREATER_BAR 295
#define yacc_EOF 296
extern YYSTYPE yylval;
#endif /* not BISON_Y_TAB_H */