mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-23 22:07:58 +02:00
commit bash-3.2 snapshot
This commit is contained in:
@@ -1,3 +1,24 @@
|
||||
This document details the changes between this version, bash-3.2-release,
|
||||
and the previous version, bash-3.2-beta.
|
||||
|
||||
1. Changes to Bash
|
||||
|
||||
a. Fixed a bug that caused the temporary environment passed to a command to
|
||||
affect the shell's environment under certain circumstances.
|
||||
|
||||
b. Fixed a bug in the printf builtin that caused the %q format specifier to
|
||||
ignore empty string arguments.
|
||||
|
||||
c. Improved multibyte character environment detection at configuration time.
|
||||
|
||||
d. Fixed a bug in the read builtin that left spurious escape characters in the
|
||||
input after processing backslashes when assigning to an array variable.
|
||||
|
||||
2. Changes to Readline
|
||||
|
||||
a. Fixed a redisplay bug that occurred in multibyte-capable locales when the
|
||||
prompt was one character longer than the screen width.
|
||||
------------------------------------------------------------------------------
|
||||
This document details the changes between this version, bash-3.2-beta,
|
||||
and the previous version, bash-3.2-alpha.
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
CWRU.chlog
|
||||
+13730
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
# From configure.in for Bash 3.2, version 3.190.
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.59 for bash 3.2-rc.
|
||||
# Generated by GNU Autoconf 2.59 for bash 3.2-release.
|
||||
#
|
||||
# Report bugs to <bug-bash@gnu.org>.
|
||||
#
|
||||
@@ -270,8 +270,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='bash'
|
||||
PACKAGE_TARNAME='bash'
|
||||
PACKAGE_VERSION='3.2-rc'
|
||||
PACKAGE_STRING='bash 3.2-rc'
|
||||
PACKAGE_VERSION='3.2-release'
|
||||
PACKAGE_STRING='bash 3.2-release'
|
||||
PACKAGE_BUGREPORT='bug-bash@gnu.org'
|
||||
|
||||
ac_unique_file="shell.h"
|
||||
@@ -785,7 +785,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures bash 3.2-rc to adapt to many kinds of systems.
|
||||
\`configure' configures bash 3.2-release to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -846,7 +846,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of bash 3.2-rc:";;
|
||||
short | recursive ) echo "Configuration of bash 3.2-release:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1039,7 +1039,7 @@ fi
|
||||
test -n "$ac_init_help" && exit 0
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
bash configure 3.2-rc
|
||||
bash configure 3.2-release
|
||||
generated by GNU Autoconf 2.59
|
||||
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
@@ -1053,7 +1053,7 @@ cat >&5 <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by bash $as_me 3.2-rc, which was
|
||||
It was created by bash $as_me 3.2-release, which was
|
||||
generated by GNU Autoconf 2.59. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -1422,7 +1422,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
|
||||
|
||||
|
||||
BASHVERS=3.2
|
||||
RELSTATUS=rc
|
||||
RELSTATUS=release
|
||||
|
||||
case "$RELSTATUS" in
|
||||
alp*|bet*|dev*|rc*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
|
||||
@@ -27791,7 +27791,7 @@ _ASBOX
|
||||
} >&5
|
||||
cat >&5 <<_CSEOF
|
||||
|
||||
This file was extended by bash $as_me 3.2-rc, which was
|
||||
This file was extended by bash $as_me 3.2-release, which was
|
||||
generated by GNU Autoconf 2.59. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -27854,7 +27854,7 @@ _ACEOF
|
||||
|
||||
cat >>$CONFIG_STATUS <<_ACEOF
|
||||
ac_cs_version="\\
|
||||
bash config.status 3.2-rc
|
||||
bash config.status 3.2-release
|
||||
configured by $0, generated by GNU Autoconf 2.59,
|
||||
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ dnl Process this file with autoconf to produce a configure script.
|
||||
AC_REVISION([for Bash 3.2, version 3.190])dnl
|
||||
|
||||
define(bashvers, 3.2)
|
||||
define(relstatus, rc)
|
||||
define(relstatus, release)
|
||||
|
||||
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
This is the Bash FAQ, version 3.33, for Bash version 3.1.
|
||||
This is the Bash FAQ, version 3.34, for Bash version 3.2.
|
||||
|
||||
This document contains a set of frequently-asked questions concerning
|
||||
Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
|
||||
@@ -9,7 +9,7 @@ Another good source of basic information about shells is the collection
|
||||
of FAQ articles periodically posted to comp.unix.shell.
|
||||
|
||||
Questions and comments concerning this document should be sent to
|
||||
chet@po.cwru.edu.
|
||||
chet.ramey@case.edu.
|
||||
|
||||
This document is available for anonymous FTP with the URL
|
||||
|
||||
@@ -36,8 +36,8 @@ A10) What is the bash `posix mode'?
|
||||
|
||||
Section B: The latest version
|
||||
|
||||
B1) What's new in version 3.1?
|
||||
B2) Are there any user-visible incompatibilities between bash-3.1 and
|
||||
B1) What's new in version 3.2?
|
||||
B2) Are there any user-visible incompatibilities between bash-3.2 and
|
||||
bash-2.05b?
|
||||
|
||||
Section C: Differences from other Unix shells
|
||||
@@ -78,6 +78,7 @@ E10) Why does `cd //' leave $PWD as `//'?
|
||||
E11) If I resize my xterm while another program is running, why doesn't bash
|
||||
notice the change?
|
||||
E12) Why don't negative offsets in substring expansion work like I expect?
|
||||
E13) Why does filename completion misbehave if a colon appears in the filename?
|
||||
|
||||
Section F: Things to watch out for on certain Unix versions
|
||||
|
||||
@@ -140,26 +141,26 @@ of Case Western Reserve University.
|
||||
|
||||
A2) What's the latest version?
|
||||
|
||||
The latest version is 3.1, first made available on 09 December, 2005.
|
||||
The latest version is 3.2, first made available on 12 October, 2006.
|
||||
|
||||
A3) Where can I get it?
|
||||
|
||||
Bash is the GNU project's shell, and so is available from the
|
||||
master GNU archive site, ftp.gnu.org, and its mirrors. The
|
||||
latest version is also available for FTP from ftp.cwru.edu.
|
||||
The following URLs tell how to get version 3.1:
|
||||
The following URLs tell how to get version 3.2:
|
||||
|
||||
ftp://ftp.gnu.org/pub/gnu/bash/bash-3.1.tar.gz
|
||||
ftp://ftp.cwru.edu/pub/bash/bash-3.1.tar.gz
|
||||
ftp://ftp.gnu.org/pub/gnu/bash/bash-3.2.tar.gz
|
||||
ftp://ftp.cwru.edu/pub/bash/bash-3.2.tar.gz
|
||||
|
||||
Formatted versions of the documentation are available with the URLs:
|
||||
|
||||
ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-3.1.tar.gz
|
||||
ftp://ftp.cwru.edu/pub/bash/bash-doc-3.1.tar.gz
|
||||
ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-3.2.tar.gz
|
||||
ftp://ftp.cwru.edu/pub/bash/bash-doc-3.2.tar.gz
|
||||
|
||||
Any patches for the current version are available with the URL:
|
||||
|
||||
ftp://ftp.cwru.edu/pub/bash/bash-3.1-patches/
|
||||
ftp://ftp.cwru.edu/pub/bash/bash-3.2-patches/
|
||||
|
||||
A4) On what machines will bash run?
|
||||
|
||||
@@ -192,7 +193,7 @@ http://www.cygwin.com/.
|
||||
Cygnus originally ported bash-1.14.7, and that port was part of their
|
||||
early GNU-Win32 (the original name) releases. Cygnus has also done
|
||||
ports of bash-2.05b and bash-3.0 to the CYGWIN environment, and both
|
||||
are available as part of their current release. Bash-3.1 is currently
|
||||
are available as part of their current release. Bash-3.2 is currently
|
||||
being tested and should be available soon.
|
||||
|
||||
Bash-2.05b and later versions should require no local Cygnus changes to
|
||||
@@ -216,7 +217,7 @@ Mark began to work with bash-2.05, but I don't know the current status.
|
||||
|
||||
Bash-3.0 compiles and runs with no modifications under Microsoft's Services
|
||||
for Unix (SFU), once known as Interix. I do not anticipate any problems
|
||||
with building bash-3.1.
|
||||
with building bash-3.1 or bash-3.2.
|
||||
|
||||
A6) How can I build bash with gcc?
|
||||
|
||||
@@ -385,12 +386,22 @@ They are also listed in a section in the Bash Reference Manual
|
||||
|
||||
Section B: The latest version
|
||||
|
||||
B1) What's new in version 3.1?
|
||||
B1) What's new in version 3.2?
|
||||
|
||||
Bash-3.1 is the first maintenance release of the third major release of
|
||||
Bash-3.2 is the second maintenance release of the third major release of
|
||||
bash. It contains the following significant new features (see the manual
|
||||
page for complete descriptions and the CHANGES and NEWS files in the
|
||||
bash-3.1 distribution).
|
||||
bash-3.2 distribution).
|
||||
|
||||
o Bash-3.2 now checks shell scripts for NUL characters rather than non-printing
|
||||
characters when deciding whether or not a script is a binary file.
|
||||
|
||||
o Quoting the string argument to the [[ command's =~ (regexp) operator now
|
||||
forces string matching, as with the other pattern-matching operators.
|
||||
|
||||
A short feature history dating from Bash-2.0:
|
||||
|
||||
Bash-3.1 contained the following new features:
|
||||
|
||||
o Bash-3.1 may now be configured and built in a mode that enforces strict
|
||||
POSIX compliance.
|
||||
@@ -401,8 +412,6 @@ o The `+=' assignment operator, which appends to the value of a string or
|
||||
o It is now possible to ignore case when matching in contexts other than
|
||||
filename generation using the new `nocasematch' shell option.
|
||||
|
||||
A short feature history dating from Bash-2.0:
|
||||
|
||||
Bash-3.0 contained the following new features:
|
||||
|
||||
o Features to support the bash debugger have been implemented, and there
|
||||
@@ -640,10 +649,10 @@ grammar tighter and smaller (66 reduce-reduce conflicts gone)
|
||||
lots of code now smaller and faster
|
||||
test suite greatly expanded
|
||||
|
||||
B2) Are there any user-visible incompatibilities between bash-3.1 and
|
||||
B2) Are there any user-visible incompatibilities between bash-3.2 and
|
||||
bash-2.05b?
|
||||
|
||||
There are a few incompatibilities between version 2.05b and version 3.1.
|
||||
There are a few incompatibilities between version 2.05b and version 3.2.
|
||||
They are detailed in the file COMPAT in the bash distribution. That file
|
||||
is not meant to be all-encompassing; send mail to bash-maintainers@gnu.org
|
||||
if if you find something that's not mentioned there.
|
||||
@@ -837,7 +846,7 @@ Implementation differences:
|
||||
|
||||
C3) Which new features in ksh-93 are not in bash, and which are?
|
||||
|
||||
New things in ksh-93 not in bash-3.0:
|
||||
New things in ksh-93 not in bash-3.2:
|
||||
associative arrays
|
||||
floating point arithmetic and variables
|
||||
math library functions
|
||||
@@ -863,7 +872,7 @@ New things in ksh-93 not in bash-3.0:
|
||||
lexical scoping for local variables in `ksh' functions
|
||||
no scoping for local variables in `POSIX' functions
|
||||
|
||||
New things in ksh-93 present in bash-3.0:
|
||||
New things in ksh-93 present in bash-3.2:
|
||||
[n]<&word- and [n]>&word- redirections (combination dup and close)
|
||||
for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
|
||||
?:, ++, --, `expr1 , expr2' arithmetic operators
|
||||
@@ -1113,7 +1122,7 @@ will try to write on a pipe without a reader. In that case, bash
|
||||
will print `Broken pipe' to stderr when ps is killed by a
|
||||
SIGPIPE.
|
||||
|
||||
As of bash-3.1, bash will not report SIGPIPE errors by default. You
|
||||
As of bash-3.1, bash does not report SIGPIPE errors by default. You
|
||||
can build a version of bash that will report such errors.
|
||||
|
||||
E3) When I have terminal escape sequences in my prompt, why does bash
|
||||
@@ -1390,6 +1399,32 @@ expanded value of param is unset or null, and $param otherwise.
|
||||
To use negative offsets that begin with a minus sign, separate the
|
||||
minus sign and the colon with a space.
|
||||
|
||||
E13) Why does filename completion misbehave if a colon appears in the filename?
|
||||
|
||||
Filename completion (and word completion in general) may appear to behave
|
||||
improperly if there is a colon in the word to be completed.
|
||||
|
||||
The colon is special to readline's word completion code: it is one of the
|
||||
characters that breaks words for the completer. Readline uses these characters
|
||||
in sort of the same way that bash uses $IFS: they break or separate the words
|
||||
the completion code hands to the application-specific or default word
|
||||
completion functions. The original intent was to make it easy to edit
|
||||
colon-separated lists (such as $PATH in bash) in various applications using
|
||||
readline for input.
|
||||
|
||||
This is complicated by the fact that some versions of the popular
|
||||
`bash-completion' programmable completion package have problems with the
|
||||
default completion behavior in the presence of colons.
|
||||
|
||||
The current set of completion word break characters is available in bash as
|
||||
the value of the COMP_WORDBREAKS variable. Removing `:' from that value is
|
||||
enough to make the colon not special to completion:
|
||||
|
||||
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
|
||||
|
||||
You can also quote the colon with a backslash to achieve the same result
|
||||
temporarily.
|
||||
|
||||
Section F: Things to watch out for on certain Unix versions
|
||||
|
||||
F1) Why can't I use command line editing in my `cmdtool'?
|
||||
@@ -1795,9 +1830,9 @@ Some of the new ksh93 pattern matching operators, like backreferencing
|
||||
|
||||
H5) When will the next release appear?
|
||||
|
||||
The next version will appear sometime in 2006. Never make predictions.
|
||||
The next version will appear sometime in 2007. Never make predictions.
|
||||
|
||||
This document is Copyright 1995-2005 by Chester Ramey.
|
||||
This document is Copyright 1995-2006 by Chester Ramey.
|
||||
|
||||
Permission is hereby granted, without written agreement and
|
||||
without license or royalty fees, to use, copy, and distribute
|
||||
|
||||
+5
-3
@@ -1,4 +1,4 @@
|
||||
\"
|
||||
.\"
|
||||
.\" MAN PAGE COMMENTS to
|
||||
.\"
|
||||
.\" Chet Ramey
|
||||
@@ -6,12 +6,12 @@
|
||||
.\" Case Western Reserve University
|
||||
.\" chet@po.cwru.edu
|
||||
.\"
|
||||
.\" Last Change: Fri Sep 8 13:43:16 EDT 2006
|
||||
.\" Last Change: Thu Sep 28 10:25:59 EDT 2006
|
||||
.\"
|
||||
.\" bash_builtins, strip all but Built-Ins section
|
||||
.if \n(zZ=1 .ig zZ
|
||||
.if \n(zY=1 .ig zY
|
||||
.TH BASH 1 "2006 September 8" "GNU Bash-3.2"
|
||||
.TH BASH 1 "2006 September 28" "GNU Bash-3.2"
|
||||
.\"
|
||||
.\" There's some problem with having a `@'
|
||||
.\" in a tagged paragraph with the BSD man macros.
|
||||
@@ -1375,6 +1375,8 @@ subsequently reset.
|
||||
.B COMP_WORDS
|
||||
An array variable (see \fBArrays\fP below) consisting of the individual
|
||||
words in the current command line.
|
||||
The words are split on shell metacharacters as the shell parser would
|
||||
separate them.
|
||||
This variable is available only in shell functions invoked by the
|
||||
programmable completion facilities (see \fBProgrammable Completion\fP
|
||||
below).
|
||||
|
||||
+201
-204
@@ -2,10 +2,10 @@ This is bashref.info, produced by makeinfo version 4.7 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.2, 27 April 2006).
|
||||
the Bash shell (version 3.2, 28 September 2006).
|
||||
|
||||
This is Edition 3.2, last updated 27 April 2006, of `The GNU Bash
|
||||
Reference Manual', for `Bash', Version 3.2.
|
||||
This is Edition 3.2, last updated 28 September 2006, of `The GNU
|
||||
Bash Reference Manual', for `Bash', Version 3.2.
|
||||
|
||||
Copyright (C) 1988-2005 Free Software Foundation, Inc.
|
||||
|
||||
@@ -37,10 +37,10 @@ Bash Features
|
||||
*************
|
||||
|
||||
This text is a brief description of the features that are present in
|
||||
the Bash shell (version 3.2, 27 April 2006).
|
||||
the Bash shell (version 3.2, 28 September 2006).
|
||||
|
||||
This is Edition 3.2, last updated 27 April 2006, of `The GNU Bash
|
||||
Reference Manual', for `Bash', Version 3.2.
|
||||
This is Edition 3.2, last updated 28 September 2006, of `The GNU
|
||||
Bash Reference Manual', for `Bash', Version 3.2.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
features that only appear in Bash. Some of the shells that Bash has
|
||||
@@ -2592,8 +2592,8 @@ standard.
|
||||
finishes executing.
|
||||
|
||||
Signals ignored upon entry to the shell cannot be trapped or reset.
|
||||
Trapped signals are reset to their original values in a child
|
||||
process when it is created.
|
||||
Trapped signals that are not being ignored are reset to their
|
||||
original values in a child process when it is created.
|
||||
|
||||
The return status is zero unless a SIGSPEC does not specify a
|
||||
valid signal.
|
||||
@@ -2862,10 +2862,6 @@ POSIX standard.
|
||||
the eight-bit character whose value is the octal value NNN
|
||||
(zero to three octal digits)
|
||||
|
||||
`\NNN'
|
||||
the eight-bit character whose value is the octal value NNN
|
||||
(one to three octal digits)
|
||||
|
||||
`\xHH'
|
||||
the eight-bit character whose value is the hexadecimal value
|
||||
HH (one or two hex digits)
|
||||
@@ -3853,9 +3849,10 @@ Variables::).
|
||||
|
||||
`COMP_WORDS'
|
||||
An array variable consisting of the individual words in the
|
||||
current command line. This variable is available only in shell
|
||||
functions invoked by the programmable completion facilities (*note
|
||||
Programmable Completion::).
|
||||
current command line. The words are split on shell metacharacters
|
||||
as the shell parser would separate them. This variable is
|
||||
available only in shell functions invoked by the programmable
|
||||
completion facilities (*note Programmable Completion::).
|
||||
|
||||
`COMPREPLY'
|
||||
An array variable from which Bash reads the possible completions
|
||||
@@ -8998,7 +8995,7 @@ Index of Shell Builtin Commands
|
||||
* disown: Job Control Builtins.
|
||||
(line 83)
|
||||
* echo: Bash Builtins. (line 191)
|
||||
* enable: Bash Builtins. (line 247)
|
||||
* enable: Bash Builtins. (line 243)
|
||||
* eval: Bourne Shell Builtins.
|
||||
(line 63)
|
||||
* exec: Bourne Shell Builtins.
|
||||
@@ -9015,24 +9012,24 @@ Index of Shell Builtin Commands
|
||||
(line 103)
|
||||
* hash: Bourne Shell Builtins.
|
||||
(line 145)
|
||||
* help: Bash Builtins. (line 275)
|
||||
* help: Bash Builtins. (line 271)
|
||||
* history: Bash History Builtins.
|
||||
(line 39)
|
||||
* jobs: Job Control Builtins.
|
||||
(line 25)
|
||||
* kill: Job Control Builtins.
|
||||
(line 57)
|
||||
* let: Bash Builtins. (line 284)
|
||||
* local: Bash Builtins. (line 291)
|
||||
* logout: Bash Builtins. (line 301)
|
||||
* let: Bash Builtins. (line 280)
|
||||
* local: Bash Builtins. (line 287)
|
||||
* logout: Bash Builtins. (line 297)
|
||||
* popd: Directory Stack Builtins.
|
||||
(line 37)
|
||||
* printf: Bash Builtins. (line 305)
|
||||
* printf: Bash Builtins. (line 301)
|
||||
* pushd: Directory Stack Builtins.
|
||||
(line 58)
|
||||
* pwd: Bourne Shell Builtins.
|
||||
(line 163)
|
||||
* read: Bash Builtins. (line 330)
|
||||
* read: Bash Builtins. (line 326)
|
||||
* readonly: Bourne Shell Builtins.
|
||||
(line 172)
|
||||
* return: Bourne Shell Builtins.
|
||||
@@ -9040,8 +9037,8 @@ Index of Shell Builtin Commands
|
||||
* set: The Set Builtin. (line 9)
|
||||
* shift: Bourne Shell Builtins.
|
||||
(line 200)
|
||||
* shopt: Bash Builtins. (line 391)
|
||||
* source: Bash Builtins. (line 622)
|
||||
* shopt: Bash Builtins. (line 387)
|
||||
* source: Bash Builtins. (line 618)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 94)
|
||||
* test: Bourne Shell Builtins.
|
||||
@@ -9050,12 +9047,12 @@ Index of Shell Builtin Commands
|
||||
(line 278)
|
||||
* trap: Bourne Shell Builtins.
|
||||
(line 283)
|
||||
* type: Bash Builtins. (line 626)
|
||||
* typeset: Bash Builtins. (line 657)
|
||||
* ulimit: Bash Builtins. (line 663)
|
||||
* type: Bash Builtins. (line 622)
|
||||
* typeset: Bash Builtins. (line 653)
|
||||
* ulimit: Bash Builtins. (line 659)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 324)
|
||||
* unalias: Bash Builtins. (line 741)
|
||||
* unalias: Bash Builtins. (line 737)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 341)
|
||||
* wait: Job Control Builtins.
|
||||
@@ -9151,65 +9148,65 @@ Parameter and Variable Index
|
||||
* COMP_WORDS: Bash Variables. (line 131)
|
||||
* completion-query-items: Readline Init File Syntax.
|
||||
(line 60)
|
||||
* COMPREPLY: Bash Variables. (line 137)
|
||||
* COMPREPLY: Bash Variables. (line 138)
|
||||
* convert-meta: Readline Init File Syntax.
|
||||
(line 70)
|
||||
* DIRSTACK: Bash Variables. (line 142)
|
||||
* DIRSTACK: Bash Variables. (line 143)
|
||||
* disable-completion: Readline Init File Syntax.
|
||||
(line 76)
|
||||
* editing-mode: Readline Init File Syntax.
|
||||
(line 81)
|
||||
* EMACS: Bash Variables. (line 152)
|
||||
* EMACS: Bash Variables. (line 153)
|
||||
* enable-keypad: Readline Init File Syntax.
|
||||
(line 87)
|
||||
* EUID: Bash Variables. (line 157)
|
||||
* EUID: Bash Variables. (line 158)
|
||||
* expand-tilde: Readline Init File Syntax.
|
||||
(line 92)
|
||||
* FCEDIT: Bash Variables. (line 161)
|
||||
* FIGNORE: Bash Variables. (line 165)
|
||||
* FUNCNAME: Bash Variables. (line 171)
|
||||
* GLOBIGNORE: Bash Variables. (line 180)
|
||||
* GROUPS: Bash Variables. (line 186)
|
||||
* histchars: Bash Variables. (line 192)
|
||||
* HISTCMD: Bash Variables. (line 207)
|
||||
* HISTCONTROL: Bash Variables. (line 212)
|
||||
* HISTFILE: Bash Variables. (line 228)
|
||||
* HISTFILESIZE: Bash Variables. (line 232)
|
||||
* HISTIGNORE: Bash Variables. (line 240)
|
||||
* FCEDIT: Bash Variables. (line 162)
|
||||
* FIGNORE: Bash Variables. (line 166)
|
||||
* FUNCNAME: Bash Variables. (line 172)
|
||||
* GLOBIGNORE: Bash Variables. (line 181)
|
||||
* GROUPS: Bash Variables. (line 187)
|
||||
* histchars: Bash Variables. (line 193)
|
||||
* HISTCMD: Bash Variables. (line 208)
|
||||
* HISTCONTROL: Bash Variables. (line 213)
|
||||
* HISTFILE: Bash Variables. (line 229)
|
||||
* HISTFILESIZE: Bash Variables. (line 233)
|
||||
* HISTIGNORE: Bash Variables. (line 241)
|
||||
* history-preserve-point: Readline Init File Syntax.
|
||||
(line 96)
|
||||
* HISTSIZE: Bash Variables. (line 259)
|
||||
* HISTTIMEFORMAT: Bash Variables. (line 263)
|
||||
* HISTSIZE: Bash Variables. (line 260)
|
||||
* HISTTIMEFORMAT: Bash Variables. (line 264)
|
||||
* HOME: Bourne Shell Variables.
|
||||
(line 13)
|
||||
* horizontal-scroll-mode: Readline Init File Syntax.
|
||||
(line 101)
|
||||
* HOSTFILE: Bash Variables. (line 270)
|
||||
* HOSTNAME: Bash Variables. (line 281)
|
||||
* HOSTTYPE: Bash Variables. (line 284)
|
||||
* HOSTFILE: Bash Variables. (line 271)
|
||||
* HOSTNAME: Bash Variables. (line 282)
|
||||
* HOSTTYPE: Bash Variables. (line 285)
|
||||
* IFS: Bourne Shell Variables.
|
||||
(line 18)
|
||||
* IGNOREEOF: Bash Variables. (line 287)
|
||||
* IGNOREEOF: Bash Variables. (line 288)
|
||||
* input-meta: Readline Init File Syntax.
|
||||
(line 108)
|
||||
* INPUTRC: Bash Variables. (line 297)
|
||||
* INPUTRC: Bash Variables. (line 298)
|
||||
* isearch-terminators: Readline Init File Syntax.
|
||||
(line 115)
|
||||
* keymap: Readline Init File Syntax.
|
||||
(line 122)
|
||||
* LANG: Bash Variables. (line 301)
|
||||
* LC_ALL: Bash Variables. (line 305)
|
||||
* LC_COLLATE: Bash Variables. (line 309)
|
||||
* LC_CTYPE: Bash Variables. (line 316)
|
||||
* LANG: Bash Variables. (line 302)
|
||||
* LC_ALL: Bash Variables. (line 306)
|
||||
* LC_COLLATE: Bash Variables. (line 310)
|
||||
* LC_CTYPE: Bash Variables. (line 317)
|
||||
* LC_MESSAGES <1>: Locale Translation. (line 11)
|
||||
* LC_MESSAGES: Bash Variables. (line 321)
|
||||
* LC_NUMERIC: Bash Variables. (line 325)
|
||||
* LINENO: Bash Variables. (line 329)
|
||||
* LINES: Bash Variables. (line 333)
|
||||
* MACHTYPE: Bash Variables. (line 338)
|
||||
* LC_MESSAGES: Bash Variables. (line 322)
|
||||
* LC_NUMERIC: Bash Variables. (line 326)
|
||||
* LINENO: Bash Variables. (line 330)
|
||||
* LINES: Bash Variables. (line 334)
|
||||
* MACHTYPE: Bash Variables. (line 339)
|
||||
* MAIL: Bourne Shell Variables.
|
||||
(line 22)
|
||||
* MAILCHECK: Bash Variables. (line 342)
|
||||
* MAILCHECK: Bash Variables. (line 343)
|
||||
* MAILPATH: Bourne Shell Variables.
|
||||
(line 27)
|
||||
* mark-modified-lines: Readline Init File Syntax.
|
||||
@@ -9220,46 +9217,46 @@ Parameter and Variable Index
|
||||
(line 145)
|
||||
* meta-flag: Readline Init File Syntax.
|
||||
(line 108)
|
||||
* OLDPWD: Bash Variables. (line 350)
|
||||
* OLDPWD: Bash Variables. (line 351)
|
||||
* OPTARG: Bourne Shell Variables.
|
||||
(line 34)
|
||||
* OPTERR: Bash Variables. (line 353)
|
||||
* OPTERR: Bash Variables. (line 354)
|
||||
* OPTIND: Bourne Shell Variables.
|
||||
(line 38)
|
||||
* OSTYPE: Bash Variables. (line 357)
|
||||
* OSTYPE: Bash Variables. (line 358)
|
||||
* output-meta: Readline Init File Syntax.
|
||||
(line 152)
|
||||
* page-completions: Readline Init File Syntax.
|
||||
(line 157)
|
||||
* PATH: Bourne Shell Variables.
|
||||
(line 42)
|
||||
* PIPESTATUS: Bash Variables. (line 360)
|
||||
* POSIXLY_CORRECT: Bash Variables. (line 365)
|
||||
* PPID: Bash Variables. (line 374)
|
||||
* PROMPT_COMMAND: Bash Variables. (line 378)
|
||||
* PIPESTATUS: Bash Variables. (line 361)
|
||||
* POSIXLY_CORRECT: Bash Variables. (line 366)
|
||||
* PPID: Bash Variables. (line 375)
|
||||
* PROMPT_COMMAND: Bash Variables. (line 379)
|
||||
* PS1: Bourne Shell Variables.
|
||||
(line 48)
|
||||
* PS2: Bourne Shell Variables.
|
||||
(line 53)
|
||||
* PS3: Bash Variables. (line 382)
|
||||
* PS4: Bash Variables. (line 387)
|
||||
* PWD: Bash Variables. (line 393)
|
||||
* RANDOM: Bash Variables. (line 396)
|
||||
* REPLY: Bash Variables. (line 401)
|
||||
* SECONDS: Bash Variables. (line 404)
|
||||
* SHELL: Bash Variables. (line 410)
|
||||
* SHELLOPTS: Bash Variables. (line 415)
|
||||
* SHLVL: Bash Variables. (line 424)
|
||||
* PS3: Bash Variables. (line 383)
|
||||
* PS4: Bash Variables. (line 388)
|
||||
* PWD: Bash Variables. (line 394)
|
||||
* RANDOM: Bash Variables. (line 397)
|
||||
* REPLY: Bash Variables. (line 402)
|
||||
* SECONDS: Bash Variables. (line 405)
|
||||
* SHELL: Bash Variables. (line 411)
|
||||
* SHELLOPTS: Bash Variables. (line 416)
|
||||
* SHLVL: Bash Variables. (line 425)
|
||||
* show-all-if-ambiguous: Readline Init File Syntax.
|
||||
(line 167)
|
||||
* show-all-if-unmodified: Readline Init File Syntax.
|
||||
(line 173)
|
||||
* TEXTDOMAIN: Locale Translation. (line 11)
|
||||
* TEXTDOMAINDIR: Locale Translation. (line 11)
|
||||
* TIMEFORMAT: Bash Variables. (line 429)
|
||||
* TMOUT: Bash Variables. (line 467)
|
||||
* TMPDIR: Bash Variables. (line 479)
|
||||
* UID: Bash Variables. (line 483)
|
||||
* TIMEFORMAT: Bash Variables. (line 430)
|
||||
* TMOUT: Bash Variables. (line 468)
|
||||
* TMPDIR: Bash Variables. (line 480)
|
||||
* UID: Bash Variables. (line 484)
|
||||
* visible-stats: Readline Init File Syntax.
|
||||
(line 182)
|
||||
|
||||
@@ -9527,129 +9524,129 @@ Concept Index
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top1351
|
||||
Node: Introduction3426
|
||||
Node: What is Bash?3654
|
||||
Node: What is a shell?4767
|
||||
Node: Definitions7308
|
||||
Node: Basic Shell Features10075
|
||||
Node: Shell Syntax11294
|
||||
Node: Shell Operation12324
|
||||
Node: Quoting13618
|
||||
Node: Escape Character14921
|
||||
Node: Single Quotes15406
|
||||
Node: Double Quotes15754
|
||||
Node: ANSI-C Quoting16879
|
||||
Node: Locale Translation17835
|
||||
Node: Comments18731
|
||||
Node: Shell Commands19345
|
||||
Node: Simple Commands20111
|
||||
Node: Pipelines20742
|
||||
Node: Lists22617
|
||||
Node: Compound Commands24248
|
||||
Node: Looping Constructs25032
|
||||
Node: Conditional Constructs27479
|
||||
Node: Command Grouping34938
|
||||
Node: Shell Functions36387
|
||||
Node: Shell Parameters40796
|
||||
Node: Positional Parameters43126
|
||||
Node: Special Parameters44026
|
||||
Node: Shell Expansions46990
|
||||
Node: Brace Expansion48915
|
||||
Node: Tilde Expansion51240
|
||||
Node: Shell Parameter Expansion53591
|
||||
Node: Command Substitution61061
|
||||
Node: Arithmetic Expansion62394
|
||||
Node: Process Substitution63244
|
||||
Node: Word Splitting64294
|
||||
Node: Filename Expansion65755
|
||||
Node: Pattern Matching67891
|
||||
Node: Quote Removal71209
|
||||
Node: Redirections71504
|
||||
Node: Executing Commands79234
|
||||
Node: Simple Command Expansion79904
|
||||
Node: Command Search and Execution81834
|
||||
Node: Command Execution Environment83840
|
||||
Node: Environment86611
|
||||
Node: Exit Status88271
|
||||
Node: Signals89475
|
||||
Node: Shell Scripts91439
|
||||
Node: Shell Builtin Commands93957
|
||||
Node: Bourne Shell Builtins95626
|
||||
Node: Bash Builtins112701
|
||||
Node: The Set Builtin142080
|
||||
Node: Special Builtins150455
|
||||
Node: Shell Variables151425
|
||||
Node: Bourne Shell Variables151865
|
||||
Node: Bash Variables153846
|
||||
Node: Bash Features174069
|
||||
Node: Invoking Bash174952
|
||||
Node: Bash Startup Files180761
|
||||
Node: Interactive Shells185619
|
||||
Node: What is an Interactive Shell?186029
|
||||
Node: Is this Shell Interactive?186679
|
||||
Node: Interactive Shell Behavior187494
|
||||
Node: Bash Conditional Expressions190770
|
||||
Node: Shell Arithmetic194349
|
||||
Node: Aliases197095
|
||||
Node: Arrays199663
|
||||
Node: The Directory Stack203012
|
||||
Node: Directory Stack Builtins203726
|
||||
Node: Printing a Prompt206617
|
||||
Node: The Restricted Shell209331
|
||||
Node: Bash POSIX Mode211163
|
||||
Node: Job Control218922
|
||||
Node: Job Control Basics219389
|
||||
Node: Job Control Builtins223765
|
||||
Node: Job Control Variables228092
|
||||
Node: Command Line Editing229250
|
||||
Node: Introduction and Notation230249
|
||||
Node: Readline Interaction231871
|
||||
Node: Readline Bare Essentials233062
|
||||
Node: Readline Movement Commands234851
|
||||
Node: Readline Killing Commands235816
|
||||
Node: Readline Arguments237736
|
||||
Node: Searching238780
|
||||
Node: Readline Init File240966
|
||||
Node: Readline Init File Syntax242113
|
||||
Node: Conditional Init Constructs254444
|
||||
Node: Sample Init File256977
|
||||
Node: Bindable Readline Commands260094
|
||||
Node: Commands For Moving261301
|
||||
Node: Commands For History262162
|
||||
Node: Commands For Text265317
|
||||
Node: Commands For Killing267990
|
||||
Node: Numeric Arguments270132
|
||||
Node: Commands For Completion271271
|
||||
Node: Keyboard Macros274864
|
||||
Node: Miscellaneous Commands275435
|
||||
Node: Readline vi Mode280746
|
||||
Node: Programmable Completion281660
|
||||
Node: Programmable Completion Builtins287452
|
||||
Node: Using History Interactively295048
|
||||
Node: Bash History Facilities295728
|
||||
Node: Bash History Builtins298423
|
||||
Node: History Interaction302280
|
||||
Node: Event Designators304836
|
||||
Node: Word Designators305851
|
||||
Node: Modifiers307490
|
||||
Node: Installing Bash308896
|
||||
Node: Basic Installation310026
|
||||
Node: Compilers and Options312718
|
||||
Node: Compiling For Multiple Architectures313459
|
||||
Node: Installation Names315123
|
||||
Node: Specifying the System Type315941
|
||||
Node: Sharing Defaults316657
|
||||
Node: Operation Controls317330
|
||||
Node: Optional Features318288
|
||||
Node: Reporting Bugs327219
|
||||
Node: Major Differences From The Bourne Shell328413
|
||||
Node: Copying This Manual345078
|
||||
Node: GNU Free Documentation License345354
|
||||
Node: Builtin Index367760
|
||||
Node: Reserved Word Index374309
|
||||
Node: Variable Index376745
|
||||
Node: Function Index387678
|
||||
Node: Concept Index394398
|
||||
Node: Top1359
|
||||
Node: Introduction3442
|
||||
Node: What is Bash?3670
|
||||
Node: What is a shell?4783
|
||||
Node: Definitions7324
|
||||
Node: Basic Shell Features10091
|
||||
Node: Shell Syntax11310
|
||||
Node: Shell Operation12340
|
||||
Node: Quoting13634
|
||||
Node: Escape Character14937
|
||||
Node: Single Quotes15422
|
||||
Node: Double Quotes15770
|
||||
Node: ANSI-C Quoting16895
|
||||
Node: Locale Translation17851
|
||||
Node: Comments18747
|
||||
Node: Shell Commands19361
|
||||
Node: Simple Commands20127
|
||||
Node: Pipelines20758
|
||||
Node: Lists22633
|
||||
Node: Compound Commands24264
|
||||
Node: Looping Constructs25048
|
||||
Node: Conditional Constructs27495
|
||||
Node: Command Grouping34954
|
||||
Node: Shell Functions36403
|
||||
Node: Shell Parameters40812
|
||||
Node: Positional Parameters43142
|
||||
Node: Special Parameters44042
|
||||
Node: Shell Expansions47006
|
||||
Node: Brace Expansion48931
|
||||
Node: Tilde Expansion51256
|
||||
Node: Shell Parameter Expansion53607
|
||||
Node: Command Substitution61077
|
||||
Node: Arithmetic Expansion62410
|
||||
Node: Process Substitution63260
|
||||
Node: Word Splitting64310
|
||||
Node: Filename Expansion65771
|
||||
Node: Pattern Matching67907
|
||||
Node: Quote Removal71225
|
||||
Node: Redirections71520
|
||||
Node: Executing Commands79250
|
||||
Node: Simple Command Expansion79920
|
||||
Node: Command Search and Execution81850
|
||||
Node: Command Execution Environment83856
|
||||
Node: Environment86627
|
||||
Node: Exit Status88287
|
||||
Node: Signals89491
|
||||
Node: Shell Scripts91455
|
||||
Node: Shell Builtin Commands93973
|
||||
Node: Bourne Shell Builtins95642
|
||||
Node: Bash Builtins112744
|
||||
Node: The Set Builtin142004
|
||||
Node: Special Builtins150379
|
||||
Node: Shell Variables151349
|
||||
Node: Bourne Shell Variables151789
|
||||
Node: Bash Variables153770
|
||||
Node: Bash Features174084
|
||||
Node: Invoking Bash174967
|
||||
Node: Bash Startup Files180776
|
||||
Node: Interactive Shells185634
|
||||
Node: What is an Interactive Shell?186044
|
||||
Node: Is this Shell Interactive?186694
|
||||
Node: Interactive Shell Behavior187509
|
||||
Node: Bash Conditional Expressions190785
|
||||
Node: Shell Arithmetic194364
|
||||
Node: Aliases197110
|
||||
Node: Arrays199678
|
||||
Node: The Directory Stack203027
|
||||
Node: Directory Stack Builtins203741
|
||||
Node: Printing a Prompt206632
|
||||
Node: The Restricted Shell209346
|
||||
Node: Bash POSIX Mode211178
|
||||
Node: Job Control218937
|
||||
Node: Job Control Basics219404
|
||||
Node: Job Control Builtins223780
|
||||
Node: Job Control Variables228107
|
||||
Node: Command Line Editing229265
|
||||
Node: Introduction and Notation230264
|
||||
Node: Readline Interaction231886
|
||||
Node: Readline Bare Essentials233077
|
||||
Node: Readline Movement Commands234866
|
||||
Node: Readline Killing Commands235831
|
||||
Node: Readline Arguments237751
|
||||
Node: Searching238795
|
||||
Node: Readline Init File240981
|
||||
Node: Readline Init File Syntax242128
|
||||
Node: Conditional Init Constructs254459
|
||||
Node: Sample Init File256992
|
||||
Node: Bindable Readline Commands260109
|
||||
Node: Commands For Moving261316
|
||||
Node: Commands For History262177
|
||||
Node: Commands For Text265332
|
||||
Node: Commands For Killing268005
|
||||
Node: Numeric Arguments270147
|
||||
Node: Commands For Completion271286
|
||||
Node: Keyboard Macros274879
|
||||
Node: Miscellaneous Commands275450
|
||||
Node: Readline vi Mode280761
|
||||
Node: Programmable Completion281675
|
||||
Node: Programmable Completion Builtins287467
|
||||
Node: Using History Interactively295063
|
||||
Node: Bash History Facilities295743
|
||||
Node: Bash History Builtins298438
|
||||
Node: History Interaction302295
|
||||
Node: Event Designators304851
|
||||
Node: Word Designators305866
|
||||
Node: Modifiers307505
|
||||
Node: Installing Bash308911
|
||||
Node: Basic Installation310041
|
||||
Node: Compilers and Options312733
|
||||
Node: Compiling For Multiple Architectures313474
|
||||
Node: Installation Names315138
|
||||
Node: Specifying the System Type315956
|
||||
Node: Sharing Defaults316672
|
||||
Node: Operation Controls317345
|
||||
Node: Optional Features318303
|
||||
Node: Reporting Bugs327234
|
||||
Node: Major Differences From The Bourne Shell328428
|
||||
Node: Copying This Manual345093
|
||||
Node: GNU Free Documentation License345369
|
||||
Node: Builtin Index367775
|
||||
Node: Reserved Word Index374324
|
||||
Node: Variable Index376760
|
||||
Node: Function Index387693
|
||||
Node: Concept Index394413
|
||||
|
||||
End Tag Table
|
||||
|
||||
@@ -4429,6 +4429,8 @@ even if it is subsequently reset.
|
||||
@item COMP_WORDS
|
||||
An array variable consisting of the individual
|
||||
words in the current command line.
|
||||
The words are split on shell metacharacters as the shell parser would
|
||||
separate them.
|
||||
This variable is available only in shell functions invoked by the
|
||||
programmable completion facilities (@pxref{Programmable Completion}).
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
texinfo.tex.20030205
|
||||
+6688
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 1988-2006 Free Software Foundation, Inc.
|
||||
@end ignore
|
||||
|
||||
@set LASTCHANGE Fri Sep 8 13:45:21 EDT 2006
|
||||
@set LASTCHANGE Thu Sep 28 10:25:45 EDT 2006
|
||||
|
||||
@set EDITION 3.2
|
||||
@set VERSION 3.2
|
||||
@set UPDATED 8 September 2006
|
||||
@set UPDATED 28 September 2006
|
||||
@set UPDATED-MONTH September 2006
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../include/ansi_stdlib.h
|
||||
@@ -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 */
|
||||
@@ -1 +0,0 @@
|
||||
../../../doc/fdl.texi
|
||||
@@ -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 +0,0 @@
|
||||
../../include/posixdir.h
|
||||
@@ -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 +0,0 @@
|
||||
../../include/posixjmp.h
|
||||
@@ -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 +0,0 @@
|
||||
../../include/posixstat.h
|
||||
@@ -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_ */
|
||||
@@ -197,6 +197,7 @@ _emx_get_screensize (swp, shp)
|
||||
#endif
|
||||
|
||||
#if defined (__MINGW32__)
|
||||
static void
|
||||
_win_get_screensize (swp, shp)
|
||||
int *swp, *shp;
|
||||
{
|
||||
@@ -206,9 +207,11 @@ _win_get_screensize (swp, shp)
|
||||
hConOut = GetStdHandle (STD_OUTPUT_HANDLE);
|
||||
if (hConOut != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
GetConsoleScreenBufferInfo (hConOut, &scr);
|
||||
*swp = scr.dwSize.X;
|
||||
*shp = scr.srWindow.Bottom - scr.srWindow.Top + 1;
|
||||
if (GetConsoleScreenBufferInfo (hConOut, &scr))
|
||||
{
|
||||
*swp = scr.dwSize.X;
|
||||
*shp = scr.srWindow.Bottom - scr.srWindow.Top + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../tilde/tilde.c
|
||||
@@ -0,0 +1,502 @@
|
||||
/* 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>
|
||||
#if defined (HAVE_PWD_H)
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#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)
|
||||
# if defined (HAVE_GETPWUID)
|
||||
extern struct passwd *getpwuid PARAMS((uid_t));
|
||||
# endif
|
||||
# if defined (HAVE_GETPWNAM)
|
||||
extern struct passwd *getpwnam PARAMS((const char *));
|
||||
# endif
|
||||
#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;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Public function to scan a string (FNAME) beginning with a tilde and find
|
||||
the portion of the string that should be passed to the tilde expansion
|
||||
function. Right now, it just calls tilde_find_suffix and allocates new
|
||||
memory, but it can be expanded to do different things later. */
|
||||
char *
|
||||
tilde_find_word (fname, flags, lenp)
|
||||
const char *fname;
|
||||
int flags, *lenp;
|
||||
{
|
||||
int x;
|
||||
char *r;
|
||||
|
||||
x = tilde_find_suffix (fname);
|
||||
if (x == 0)
|
||||
{
|
||||
r = savestring (fname);
|
||||
if (lenp)
|
||||
*lenp = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
r = (char *)xmalloc (1 + x);
|
||||
strncpy (r, fname, x);
|
||||
r[x] = '\0';
|
||||
if (lenp)
|
||||
*lenp = x;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 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;
|
||||
#if defined (HAVE_GETPWNAM)
|
||||
user_entry = getpwnam (username);
|
||||
#else
|
||||
user_entry = 0;
|
||||
#endif
|
||||
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);
|
||||
}
|
||||
}
|
||||
/* 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);
|
||||
}
|
||||
#if defined (HAVE_GETPWENT)
|
||||
else
|
||||
dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len);
|
||||
#endif
|
||||
|
||||
free (username);
|
||||
#if defined (HAVE_GETPWENT)
|
||||
endpwent ();
|
||||
#endif
|
||||
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 +0,0 @@
|
||||
../tilde/tilde.h
|
||||
@@ -0,0 +1,81 @@
|
||||
/* 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 *));
|
||||
|
||||
/* Find the portion of the string beginning with ~ that should be expanded. */
|
||||
extern char *tilde_find_word PARAMS((const char *, int, int *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _TILDE_H_ */
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Reference in New Issue
Block a user