commit bash-3.1 snapshot

This commit is contained in:
Chet Ramey
2011-12-03 13:54:04 -05:00
parent 5c26afb81f
commit 8f01d942d3
16 changed files with 20687 additions and 181 deletions
+9
View File
@@ -1,3 +1,12 @@
This document details the changes between this version, bash-3.1-release,
and the previous version, bash-3.1-rc2.
1. Changes to Readline
a. Several changes to the multibyte redisplay code to fix problems with
prompts containing invisible characters.
------------------------------------------------------------------------------
This document details the changes between this version, bash-3.1-rc2,
and the previous version, bash-3.1-rc1.
+1 -1
View File
@@ -1,5 +1,5 @@
This document details the incompatibilites between this version of bash,
bash-3.0, and a previous widely-available version, bash-1.14 (which
bash-3.1, and a previous widely-available version, bash-1.14 (which
is still the `standard' version for a few Linux distributions). These
were discovered by users of bash-2.x and 3.x, so this list is not
comprehensive. Some of these incompatibilities occur between the current
-1
View File
@@ -1 +0,0 @@
CWRU.chlog
+12477
View File
File diff suppressed because it is too large Load Diff
+44 -35
View File
@@ -1,4 +1,4 @@
This is the Bash FAQ, version 3.31, for Bash version 3.0.
This is the Bash FAQ, version 3.32, for Bash version 3.1.
This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
@@ -36,9 +36,9 @@ A10) What is the bash `posix mode'?
Section B: The latest version
B1) What's new in version 3.0?
B2) Are there any user-visible incompatibilities between bash-3.0 and
bash-1.14.7?
B1) What's new in version 3.1?
B2) Are there any user-visible incompatibilities between bash-3.1 and
bash-2.05b?
Section C: Differences from other Unix shells
@@ -140,26 +140,26 @@ of Case Western Reserve University.
A2) What's the latest version?
The latest version is 3.0, first made available on 27 July, 2004.
The latest version is 3.1, first made available on 09 December, 2005.
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.0:
The following URLs tell how to get version 3.1:
ftp://ftp.gnu.org/pub/gnu/bash/bash-3.0.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-3.0.tar.gz
ftp://ftp.gnu.org/pub/gnu/bash/bash-3.1.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-3.1.tar.gz
Formatted versions of the documentation are available with the URLs:
ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-3.0.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-3.0.tar.gz
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
Any patches for the current version are available with the URL:
ftp://ftp.cwru.edu/pub/bash/bash-3.0-patches/
ftp://ftp.cwru.edu/pub/bash/bash-3.1-patches/
A4) On what machines will bash run?
@@ -190,10 +190,10 @@ of their CYGWIN project. For more information about the project, see
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 a
port of bash-2.05b to the CYGWIN environment, and it is available as
part of their current release. Bash-3.0 is currently being tested and
should be available soon.
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
being tested and should be available soon.
Bash-2.05b and later versions should require no local Cygnus changes to
build and run under CYGWIN.
@@ -215,7 +215,8 @@ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204s.zip source
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.
for Unix (SFU), once known as Interix. I do not anticipate any problems
with building bash-3.1.
A6) How can I build bash with gcc?
@@ -384,15 +385,25 @@ They are also listed in a section in the Bash Reference Manual
Section B: The latest version
B1) What's new in version 3.0?
B1) What's new in version 3.1?
Bash-3.0 is the third major release of bash. The features introduced
in the intermediate releases following bash-2.05 have been completed.
Support for the bash debugger (a separate project) has been integrated.
Bash-3.1 is the first 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.0 contains the following new features (see the manual page for
complete descriptions and the CHANGES and NEWS files in the bash-3.0
distribution):
o Bash-3.1 may now be configured and built in a mode that enforces strict
POSIX compliance.
o The `+=' assignment operator, which appends to the value of a string or
array variable, has been implemented.
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
is a new `extdebug' option to turn the non-default options on
@@ -422,8 +433,6 @@ o The `jobs', `kill', and `wait' builtins now accept job control notation
o The `gettext' package and libintl have been integrated, and the shell
messages may be translated into other languages
A short feature history dating from Bash-2.0:
Bash-2.05b introduced the following new features:
o support for multibyte characters has been added to both bash and readline
@@ -631,10 +640,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.0 and
bash-1.14.7?
B2) Are there any user-visible incompatibilities between bash-3.1 and
bash-2.05b?
There are a few incompatibilities between version 1.14.7 and version 3.0.
There are a few incompatibilities between version 2.05b and version 3.1.
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.
@@ -717,11 +726,12 @@ Things bash has that sh does not:
case-insensitive pattern matching and globbing
variable assignments preceding commands affect only that command,
even for builtins and functions
posix mode
posix mode and strict posix conformance
redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr,
/dev/tcp/host/port, /dev/udp/host/port
debugger support, including `caller' builtin and new variables
RETURN trap
the `+=' assignment operator
Things sh has that bash does not:
@@ -799,6 +809,7 @@ Things bash has or uses that ksh88 does not:
RETURN trap
Timestamps in history entries
{x..y} brace expansion
The `+=' assignment operator
Things ksh88 has or uses that bash does not:
tracked aliases (alias -t)
@@ -845,7 +856,6 @@ New things in ksh-93 not in bash-3.0:
`fc' has been renamed to `hist'
`.' can execute shell functions
exit statuses between 0 and 255
`+=' variable assignment operator
FPATH and PATH mixing
getopts -a
-I invocation option
@@ -879,6 +889,7 @@ New things in ksh-93 present in bash-3.0:
command name completion
ENV processed only for interactive shells
set -o pipefail
The `+=' assignment operator
Section D: Why does bash do some things differently than other Unix shells?
@@ -1102,9 +1113,8 @@ 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.
You can build a version of bash that will not report SIGPIPE errors
by uncommenting the definition of DONT_REPORT_SIGPIPE in the file
config-top.h.
As of bash-3.1, bash will 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
wrap lines at the wrong column?
@@ -1770,14 +1780,13 @@ a bash programmer's guide with a chapter on creating loadable builtins
a better loadable interface to perl with access to the shell builtins and
variables (contributions gratefully accepted)
ksh93-like `nameref' variables
ksh93-like `+=' variable assignment operator
ksh93-like `xx.yy' variables (including some of the .sh.* variables) and
associated disipline functions
Some of the new ksh93 pattern matching operators, like backreferencing
H5) When will the next release appear?
The next version will appear sometime in 2005. Never make predictions.
The next version will appear sometime in 2006. Never make predictions.
This document is Copyright 1995-2005 by Chester Ramey.
-1
View File
@@ -1 +0,0 @@
texinfo.tex.20030205
+6688
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -1 +0,0 @@
../../include/ansi_stdlib.h
+54
View File
@@ -0,0 +1,54 @@
/* ansi_stdlib.h -- An ANSI Standard stdlib.h. */
/* A minimal stdlib.h containing extern declarations for those functions
that bash uses. */
/* Copyright (C) 1993 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_STDLIB_H_)
#define _STDLIB_H_ 1
/* String conversion functions. */
extern int atoi ();
extern double atof ();
extern double strtod ();
/* Memory allocation functions. */
/* Generic pointer type. */
#ifndef PTR_T
#if defined (__STDC__)
# define PTR_T void *
#else
# define PTR_T char *
#endif
#endif /* PTR_T */
extern PTR_T malloc ();
extern PTR_T realloc ();
extern void free ();
/* Other miscellaneous functions. */
extern void abort ();
extern void exit ();
extern char *getenv ();
extern void qsort ();
#endif /* _STDLIB_H */
-1
View File
@@ -1 +0,0 @@
../../../doc/fdl.texi
+452
View File
@@ -0,0 +1,452 @@
@node GNU Free Documentation License
@appendixsec GNU Free Documentation License
@cindex FDL, GNU Free Documentation License
@center Version 1.2, November 2002
@display
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document @dfn{free} in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
@item
APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The ``Document'', below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as ``you''. You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A ``Secondary Section'' is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject. (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
@sc{ascii} without markup, Texinfo input format, La@TeX{} input
format, @acronym{SGML} or @acronym{XML} using a publicly available
@acronym{DTD}, and standard-conforming simple @acronym{HTML},
PostScript or @acronym{PDF} designed for human modification. Examples
of transparent image formats include @acronym{PNG}, @acronym{XCF} and
@acronym{JPG}. Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, @acronym{SGML} or
@acronym{XML} for which the @acronym{DTD} and/or processing tools are
not generally available, and the machine-generated @acronym{HTML},
PostScript or @acronym{PDF} produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as ``Acknowledgements'',
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
@item
VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
@item
COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
@item
MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
@enumerate A
@item
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
@item
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
@item
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
@item
Preserve all the copyright notices of the Document.
@item
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
@item
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
@item
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
@item
Include an unaltered copy of this License.
@item
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
@item
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@item
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
Do not retitle any existing section to be Entitled ``Endorsements'' or
to conflict in title with any Invariant Section.
@item
Preserve any Warranty Disclaimers.
@end enumerate
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
@item
COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled ``History''
in the various original documents, forming one section Entitled
``History''; likewise combine any sections Entitled ``Acknowledgements'',
and any sections Entitled ``Dedications''. You must delete all
sections Entitled ``Endorsements.''
@item
COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
@item
TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
@item
TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
@item
FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
@uref{http://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
@end enumerate
@page
@appendixsubsec ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
@smallexample
@group
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the ``with...Texts.'' line with this:
@smallexample
@group
with the Invariant Sections being @var{list their titles}, with
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
being @var{list}.
@end group
@end smallexample
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:
-1
View File
@@ -1 +0,0 @@
../../include/posixdir.h
+61
View File
@@ -0,0 +1,61 @@
/* posixdir.h -- Posix directory reading includes and defines. */
/* Copyright (C) 1987,1991 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
/* This file should be included instead of <dirent.h> or <sys/dir.h>. */
#if !defined (_POSIXDIR_H_)
#define _POSIXDIR_H_
#if defined (HAVE_DIRENT_H)
# include <dirent.h>
# if defined (HAVE_STRUCT_DIRENT_D_NAMLEN)
# define D_NAMLEN(d) ((d)->d_namlen)
# else
# define D_NAMLEN(d) (strlen ((d)->d_name))
# endif /* !HAVE_STRUCT_DIRENT_D_NAMLEN */
#else
# if defined (HAVE_SYS_NDIR_H)
# include <sys/ndir.h>
# endif
# if defined (HAVE_SYS_DIR_H)
# include <sys/dir.h>
# endif
# if defined (HAVE_NDIR_H)
# include <ndir.h>
# endif
# if !defined (dirent)
# define dirent direct
# endif /* !dirent */
# define D_NAMLEN(d) ((d)->d_namlen)
#endif /* !HAVE_DIRENT_H */
#if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (HAVE_STRUCT_DIRENT_D_FILENO)
# define d_fileno d_ino
#endif
#if defined (_POSIX_SOURCE) && (!defined (HAVE_STRUCT_DIRENT_D_INO) || defined (BROKEN_DIRENT_D_INO))
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
# define REAL_DIR_ENTRY(dp) 1
#else
# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
#endif /* _POSIX_SOURCE */
#endif /* !_POSIXDIR_H_ */
-1
View File
@@ -1 +0,0 @@
../../include/posixjmp.h
+40
View File
@@ -0,0 +1,40 @@
/* posixjmp.h -- wrapper for setjmp.h with changes for POSIX systems. */
/* Copyright (C) 1987,1991 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#ifndef _POSIXJMP_H_
#define _POSIXJMP_H_
#include <setjmp.h>
/* This *must* be included *after* config.h */
#if defined (HAVE_POSIX_SIGSETJMP)
# define procenv_t sigjmp_buf
# if !defined (__OPENNT)
# undef setjmp
# define setjmp(x) sigsetjmp((x), 1)
# undef longjmp
# define longjmp(x, n) siglongjmp((x), (n))
# endif /* !__OPENNT */
#else
# define procenv_t jmp_buf
#endif
#endif /* _POSIXJMP_H_ */
-1
View File
@@ -1 +0,0 @@
../../include/posixstat.h
+142
View File
@@ -0,0 +1,142 @@
/* posixstat.h -- Posix stat(2) definitions for systems that
don't have them. */
/* Copyright (C) 1987,1991 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
/* This file should be included instead of <sys/stat.h>.
It relies on the local sys/stat.h to work though. */
#if !defined (_POSIXSTAT_H_)
#define _POSIXSTAT_H_
#include <sys/stat.h>
#if defined (STAT_MACROS_BROKEN)
# undef S_ISBLK
# undef S_ISCHR
# undef S_ISDIR
# undef S_ISFIFO
# undef S_ISREG
# undef S_ISLNK
#endif /* STAT_MACROS_BROKEN */
/* These are guaranteed to work only on isc386 */
#if !defined (S_IFDIR) && !defined (S_ISDIR)
# define S_IFDIR 0040000
#endif /* !S_IFDIR && !S_ISDIR */
#if !defined (S_IFMT)
# define S_IFMT 0170000
#endif /* !S_IFMT */
/* Posix 1003.1 5.6.1.1 <sys/stat.h> file types */
/* Some Posix-wannabe systems define _S_IF* macros instead of S_IF*, but
do not provide the S_IS* macros that Posix requires. */
#if defined (_S_IFMT) && !defined (S_IFMT)
#define S_IFMT _S_IFMT
#endif
#if defined (_S_IFIFO) && !defined (S_IFIFO)
#define S_IFIFO _S_IFIFO
#endif
#if defined (_S_IFCHR) && !defined (S_IFCHR)
#define S_IFCHR _S_IFCHR
#endif
#if defined (_S_IFDIR) && !defined (S_IFDIR)
#define S_IFDIR _S_IFDIR
#endif
#if defined (_S_IFBLK) && !defined (S_IFBLK)
#define S_IFBLK _S_IFBLK
#endif
#if defined (_S_IFREG) && !defined (S_IFREG)
#define S_IFREG _S_IFREG
#endif
#if defined (_S_IFLNK) && !defined (S_IFLNK)
#define S_IFLNK _S_IFLNK
#endif
#if defined (_S_IFSOCK) && !defined (S_IFSOCK)
#define S_IFSOCK _S_IFSOCK
#endif
/* Test for each symbol individually and define the ones necessary (some
systems claiming Posix compatibility define some but not all). */
#if defined (S_IFBLK) && !defined (S_ISBLK)
#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) /* block device */
#endif
#if defined (S_IFCHR) && !defined (S_ISCHR)
#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) /* character device */
#endif
#if defined (S_IFDIR) && !defined (S_ISDIR)
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) /* directory */
#endif
#if defined (S_IFREG) && !defined (S_ISREG)
#define S_ISREG(m) (((m)&S_IFMT) == S_IFREG) /* file */
#endif
#if defined (S_IFIFO) && !defined (S_ISFIFO)
#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO) /* fifo - named pipe */
#endif
#if defined (S_IFLNK) && !defined (S_ISLNK)
#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK) /* symbolic link */
#endif
#if defined (S_IFSOCK) && !defined (S_ISSOCK)
#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK) /* socket */
#endif
/*
* POSIX 1003.1 5.6.1.2 <sys/stat.h> File Modes
*/
#if !defined (S_IRWXU)
# if !defined (S_IREAD)
# define S_IREAD 00400
# define S_IWRITE 00200
# define S_IEXEC 00100
# endif /* S_IREAD */
# if !defined (S_IRUSR)
# define S_IRUSR S_IREAD /* read, owner */
# define S_IWUSR S_IWRITE /* write, owner */
# define S_IXUSR S_IEXEC /* execute, owner */
# define S_IRGRP (S_IREAD >> 3) /* read, group */
# define S_IWGRP (S_IWRITE >> 3) /* write, group */
# define S_IXGRP (S_IEXEC >> 3) /* execute, group */
# define S_IROTH (S_IREAD >> 6) /* read, other */
# define S_IWOTH (S_IWRITE >> 6) /* write, other */
# define S_IXOTH (S_IEXEC >> 6) /* execute, other */
# endif /* !S_IRUSR */
# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
#endif /* !S_IRWXU */
/* These are non-standard, but are used in builtins.c$symbolic_umask() */
#define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH)
#define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH)
#define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
#endif /* _POSIXSTAT_H_ */
-1
View File
@@ -1 +0,0 @@
../tilde/tilde.c
+502
View File
@@ -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);
}
}
free (username);
/* If we don't have a failure hook, or if the failure hook did not
expand the tilde, return a copy of what we were passed. */
if (dirname == 0)
dirname = savestring (filename);
}
else
{
free (username);
dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len);
}
#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
View File
@@ -1 +0,0 @@
../tilde/tilde.h
+81
View File
@@ -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
View File
Regular → Executable
View File
Regular → Executable
View File
+136 -136
View File
@@ -1,5 +1,5 @@
/* A Bison parser, made from /Users/chet/src/bash/src/parse.y
/* A Bison parser, made from /usr/src/local/chet/src/bash/src/parse.y
by GNU Bison version 1.28 */
#define YYBISON 1 /* Identify Bison output. */
@@ -45,7 +45,7 @@
#define GREATER_BAR 295
#define yacc_EOF 296
#line 21 "/Users/chet/src/bash/src/parse.y"
#line 21 "/usr/src/local/chet/src/bash/src/parse.y"
#include "config.h"
@@ -324,7 +324,7 @@ static WORD_DESC *word_desc_to_read;
static REDIRECTEE redir;
#line 300 "/Users/chet/src/bash/src/parse.y"
#line 300 "/usr/src/local/chet/src/bash/src/parse.y"
typedef union {
WORD_DESC *word; /* the word that we read. */
int number; /* the number that we read. */
@@ -1293,7 +1293,7 @@ yyreduce:
switch (yyn) {
case 1:
#line 352 "/Users/chet/src/bash/src/parse.y"
#line 352 "/usr/src/local/chet/src/bash/src/parse.y"
{
/* Case of regular command. Discard the error
safety net,and return the command just parsed. */
@@ -1304,7 +1304,7 @@ case 1:
;
break;}
case 2:
#line 361 "/Users/chet/src/bash/src/parse.y"
#line 361 "/usr/src/local/chet/src/bash/src/parse.y"
{
/* Case of regular command, but not a very
interesting one. Return a NULL command. */
@@ -1313,7 +1313,7 @@ case 2:
;
break;}
case 3:
#line 368 "/Users/chet/src/bash/src/parse.y"
#line 368 "/usr/src/local/chet/src/bash/src/parse.y"
{
/* Error during parsing. Return NULL command. */
global_command = (COMMAND *)NULL;
@@ -1330,7 +1330,7 @@ case 3:
;
break;}
case 4:
#line 383 "/Users/chet/src/bash/src/parse.y"
#line 383 "/usr/src/local/chet/src/bash/src/parse.y"
{
/* Case of EOF seen by itself. Do ignoreeof or
not. */
@@ -1340,57 +1340,57 @@ case 4:
;
break;}
case 5:
#line 393 "/Users/chet/src/bash/src/parse.y"
#line 393 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.word_list = make_word_list (yyvsp[0].word, (WORD_LIST *)NULL); ;
break;}
case 6:
#line 395 "/Users/chet/src/bash/src/parse.y"
#line 395 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.word_list = make_word_list (yyvsp[0].word, yyvsp[-1].word_list); ;
break;}
case 7:
#line 399 "/Users/chet/src/bash/src/parse.y"
#line 399 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (1, r_output_direction, redir);
;
break;}
case 8:
#line 404 "/Users/chet/src/bash/src/parse.y"
#line 404 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (0, r_input_direction, redir);
;
break;}
case 9:
#line 409 "/Users/chet/src/bash/src/parse.y"
#line 409 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (yyvsp[-2].number, r_output_direction, redir);
;
break;}
case 10:
#line 414 "/Users/chet/src/bash/src/parse.y"
#line 414 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (yyvsp[-2].number, r_input_direction, redir);
;
break;}
case 11:
#line 419 "/Users/chet/src/bash/src/parse.y"
#line 419 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (1, r_appending_to, redir);
;
break;}
case 12:
#line 424 "/Users/chet/src/bash/src/parse.y"
#line 424 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (yyvsp[-2].number, r_appending_to, redir);
;
break;}
case 13:
#line 429 "/Users/chet/src/bash/src/parse.y"
#line 429 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (0, r_reading_until, redir);
@@ -1398,7 +1398,7 @@ case 13:
;
break;}
case 14:
#line 435 "/Users/chet/src/bash/src/parse.y"
#line 435 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (yyvsp[-2].number, r_reading_until, redir);
@@ -1406,77 +1406,77 @@ case 14:
;
break;}
case 15:
#line 441 "/Users/chet/src/bash/src/parse.y"
#line 441 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (0, r_reading_string, redir);
;
break;}
case 16:
#line 446 "/Users/chet/src/bash/src/parse.y"
#line 446 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (yyvsp[-2].number, r_reading_string, redir);
;
break;}
case 17:
#line 451 "/Users/chet/src/bash/src/parse.y"
#line 451 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.dest = yyvsp[0].number;
yyval.redirect = make_redirection (0, r_duplicating_input, redir);
;
break;}
case 18:
#line 456 "/Users/chet/src/bash/src/parse.y"
#line 456 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.dest = yyvsp[0].number;
yyval.redirect = make_redirection (yyvsp[-2].number, r_duplicating_input, redir);
;
break;}
case 19:
#line 461 "/Users/chet/src/bash/src/parse.y"
#line 461 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.dest = yyvsp[0].number;
yyval.redirect = make_redirection (1, r_duplicating_output, redir);
;
break;}
case 20:
#line 466 "/Users/chet/src/bash/src/parse.y"
#line 466 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.dest = yyvsp[0].number;
yyval.redirect = make_redirection (yyvsp[-2].number, r_duplicating_output, redir);
;
break;}
case 21:
#line 471 "/Users/chet/src/bash/src/parse.y"
#line 471 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (0, r_duplicating_input_word, redir);
;
break;}
case 22:
#line 476 "/Users/chet/src/bash/src/parse.y"
#line 476 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (yyvsp[-2].number, r_duplicating_input_word, redir);
;
break;}
case 23:
#line 481 "/Users/chet/src/bash/src/parse.y"
#line 481 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (1, r_duplicating_output_word, redir);
;
break;}
case 24:
#line 486 "/Users/chet/src/bash/src/parse.y"
#line 486 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (yyvsp[-2].number, r_duplicating_output_word, redir);
;
break;}
case 25:
#line 491 "/Users/chet/src/bash/src/parse.y"
#line 491 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection
@@ -1485,7 +1485,7 @@ case 25:
;
break;}
case 26:
#line 498 "/Users/chet/src/bash/src/parse.y"
#line 498 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection
@@ -1494,88 +1494,88 @@ case 26:
;
break;}
case 27:
#line 505 "/Users/chet/src/bash/src/parse.y"
#line 505 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.dest = 0;
yyval.redirect = make_redirection (1, r_close_this, redir);
;
break;}
case 28:
#line 510 "/Users/chet/src/bash/src/parse.y"
#line 510 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.dest = 0;
yyval.redirect = make_redirection (yyvsp[-2].number, r_close_this, redir);
;
break;}
case 29:
#line 515 "/Users/chet/src/bash/src/parse.y"
#line 515 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.dest = 0;
yyval.redirect = make_redirection (0, r_close_this, redir);
;
break;}
case 30:
#line 520 "/Users/chet/src/bash/src/parse.y"
#line 520 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.dest = 0;
yyval.redirect = make_redirection (yyvsp[-2].number, r_close_this, redir);
;
break;}
case 31:
#line 525 "/Users/chet/src/bash/src/parse.y"
#line 525 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (1, r_err_and_out, redir);
;
break;}
case 32:
#line 530 "/Users/chet/src/bash/src/parse.y"
#line 530 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (yyvsp[-2].number, r_input_output, redir);
;
break;}
case 33:
#line 535 "/Users/chet/src/bash/src/parse.y"
#line 535 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (0, r_input_output, redir);
;
break;}
case 34:
#line 540 "/Users/chet/src/bash/src/parse.y"
#line 540 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (1, r_output_force, redir);
;
break;}
case 35:
#line 545 "/Users/chet/src/bash/src/parse.y"
#line 545 "/usr/src/local/chet/src/bash/src/parse.y"
{
redir.filename = yyvsp[0].word;
yyval.redirect = make_redirection (yyvsp[-2].number, r_output_force, redir);
;
break;}
case 36:
#line 552 "/Users/chet/src/bash/src/parse.y"
#line 552 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.element.word = yyvsp[0].word; yyval.element.redirect = 0; ;
break;}
case 37:
#line 554 "/Users/chet/src/bash/src/parse.y"
#line 554 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.element.word = yyvsp[0].word; yyval.element.redirect = 0; ;
break;}
case 38:
#line 556 "/Users/chet/src/bash/src/parse.y"
#line 556 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.element.redirect = yyvsp[0].redirect; yyval.element.word = 0; ;
break;}
case 39:
#line 560 "/Users/chet/src/bash/src/parse.y"
#line 560 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.redirect = yyvsp[0].redirect;
;
break;}
case 40:
#line 564 "/Users/chet/src/bash/src/parse.y"
#line 564 "/usr/src/local/chet/src/bash/src/parse.y"
{
register REDIRECT *t;
@@ -1586,23 +1586,23 @@ case 40:
;
break;}
case 41:
#line 575 "/Users/chet/src/bash/src/parse.y"
#line 575 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_simple_command (yyvsp[0].element, (COMMAND *)NULL); ;
break;}
case 42:
#line 577 "/Users/chet/src/bash/src/parse.y"
#line 577 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_simple_command (yyvsp[0].element, yyvsp[-1].command); ;
break;}
case 43:
#line 581 "/Users/chet/src/bash/src/parse.y"
#line 581 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = clean_simple_command (yyvsp[0].command); ;
break;}
case 44:
#line 583 "/Users/chet/src/bash/src/parse.y"
#line 583 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 45:
#line 585 "/Users/chet/src/bash/src/parse.y"
#line 585 "/usr/src/local/chet/src/bash/src/parse.y"
{
COMMAND *tc;
@@ -1620,218 +1620,218 @@ case 45:
;
break;}
case 46:
#line 601 "/Users/chet/src/bash/src/parse.y"
#line 601 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 47:
#line 605 "/Users/chet/src/bash/src/parse.y"
#line 605 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 48:
#line 607 "/Users/chet/src/bash/src/parse.y"
#line 607 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 49:
#line 609 "/Users/chet/src/bash/src/parse.y"
#line 609 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_while_command (yyvsp[-3].command, yyvsp[-1].command); ;
break;}
case 50:
#line 611 "/Users/chet/src/bash/src/parse.y"
#line 611 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_until_command (yyvsp[-3].command, yyvsp[-1].command); ;
break;}
case 51:
#line 613 "/Users/chet/src/bash/src/parse.y"
#line 613 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 52:
#line 615 "/Users/chet/src/bash/src/parse.y"
#line 615 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 53:
#line 617 "/Users/chet/src/bash/src/parse.y"
#line 617 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 54:
#line 619 "/Users/chet/src/bash/src/parse.y"
#line 619 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 55:
#line 621 "/Users/chet/src/bash/src/parse.y"
#line 621 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 56:
#line 623 "/Users/chet/src/bash/src/parse.y"
#line 623 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 57:
#line 625 "/Users/chet/src/bash/src/parse.y"
#line 625 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 58:
#line 629 "/Users/chet/src/bash/src/parse.y"
#line 629 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_for_command (yyvsp[-4].word, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 59:
#line 634 "/Users/chet/src/bash/src/parse.y"
#line 634 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_for_command (yyvsp[-4].word, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 60:
#line 639 "/Users/chet/src/bash/src/parse.y"
#line 639 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_for_command (yyvsp[-5].word, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 61:
#line 644 "/Users/chet/src/bash/src/parse.y"
#line 644 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_for_command (yyvsp[-5].word, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 62:
#line 649 "/Users/chet/src/bash/src/parse.y"
#line 649 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_for_command (yyvsp[-8].word, REVERSE_LIST (yyvsp[-5].word_list, WORD_LIST *), yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 63:
#line 654 "/Users/chet/src/bash/src/parse.y"
#line 654 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_for_command (yyvsp[-8].word, REVERSE_LIST (yyvsp[-5].word_list, WORD_LIST *), yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 64:
#line 659 "/Users/chet/src/bash/src/parse.y"
#line 659 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_for_command (yyvsp[-7].word, (WORD_LIST *)NULL, yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 65:
#line 664 "/Users/chet/src/bash/src/parse.y"
#line 664 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_for_command (yyvsp[-7].word, (WORD_LIST *)NULL, yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 66:
#line 671 "/Users/chet/src/bash/src/parse.y"
#line 671 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_arith_for_command (yyvsp[-5].word_list, yyvsp[-1].command, arith_for_lineno);
if (word_top > 0) word_top--;
;
break;}
case 67:
#line 676 "/Users/chet/src/bash/src/parse.y"
#line 676 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_arith_for_command (yyvsp[-5].word_list, yyvsp[-1].command, arith_for_lineno);
if (word_top > 0) word_top--;
;
break;}
case 68:
#line 681 "/Users/chet/src/bash/src/parse.y"
#line 681 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_arith_for_command (yyvsp[-3].word_list, yyvsp[-1].command, arith_for_lineno);
if (word_top > 0) word_top--;
;
break;}
case 69:
#line 686 "/Users/chet/src/bash/src/parse.y"
#line 686 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_arith_for_command (yyvsp[-3].word_list, yyvsp[-1].command, arith_for_lineno);
if (word_top > 0) word_top--;
;
break;}
case 70:
#line 693 "/Users/chet/src/bash/src/parse.y"
#line 693 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_select_command (yyvsp[-4].word, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 71:
#line 698 "/Users/chet/src/bash/src/parse.y"
#line 698 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_select_command (yyvsp[-4].word, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 72:
#line 703 "/Users/chet/src/bash/src/parse.y"
#line 703 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_select_command (yyvsp[-5].word, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 73:
#line 708 "/Users/chet/src/bash/src/parse.y"
#line 708 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_select_command (yyvsp[-5].word, add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 74:
#line 713 "/Users/chet/src/bash/src/parse.y"
#line 713 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_select_command (yyvsp[-8].word, REVERSE_LIST (yyvsp[-5].word_list, WORD_LIST *), yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 75:
#line 718 "/Users/chet/src/bash/src/parse.y"
#line 718 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_select_command (yyvsp[-8].word, REVERSE_LIST (yyvsp[-5].word_list, WORD_LIST *), yyvsp[-1].command, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 76:
#line 725 "/Users/chet/src/bash/src/parse.y"
#line 725 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_case_command (yyvsp[-4].word, (PATTERN_LIST *)NULL, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 77:
#line 730 "/Users/chet/src/bash/src/parse.y"
#line 730 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_case_command (yyvsp[-5].word, yyvsp[-2].pattern, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 78:
#line 735 "/Users/chet/src/bash/src/parse.y"
#line 735 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_case_command (yyvsp[-4].word, yyvsp[-1].pattern, word_lineno[word_top]);
if (word_top > 0) word_top--;
;
break;}
case 79:
#line 742 "/Users/chet/src/bash/src/parse.y"
#line 742 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_function_def (yyvsp[-4].word, yyvsp[0].command, function_dstart, function_bstart); ;
break;}
case 80:
#line 745 "/Users/chet/src/bash/src/parse.y"
#line 745 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_function_def (yyvsp[-4].word, yyvsp[0].command, function_dstart, function_bstart); ;
break;}
case 81:
#line 748 "/Users/chet/src/bash/src/parse.y"
#line 748 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_function_def (yyvsp[-2].word, yyvsp[0].command, function_dstart, function_bstart); ;
break;}
case 82:
#line 753 "/Users/chet/src/bash/src/parse.y"
#line 753 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 83:
#line 755 "/Users/chet/src/bash/src/parse.y"
#line 755 "/usr/src/local/chet/src/bash/src/parse.y"
{
COMMAND *tc;
@@ -1862,82 +1862,82 @@ case 83:
;
break;}
case 84:
#line 786 "/Users/chet/src/bash/src/parse.y"
#line 786 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = make_subshell_command (yyvsp[-1].command);
yyval.command->flags |= CMD_WANT_SUBSHELL;
;
break;}
case 85:
#line 793 "/Users/chet/src/bash/src/parse.y"
#line 793 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_if_command (yyvsp[-3].command, yyvsp[-1].command, (COMMAND *)NULL); ;
break;}
case 86:
#line 795 "/Users/chet/src/bash/src/parse.y"
#line 795 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_if_command (yyvsp[-5].command, yyvsp[-3].command, yyvsp[-1].command); ;
break;}
case 87:
#line 797 "/Users/chet/src/bash/src/parse.y"
#line 797 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_if_command (yyvsp[-4].command, yyvsp[-2].command, yyvsp[-1].command); ;
break;}
case 88:
#line 802 "/Users/chet/src/bash/src/parse.y"
#line 802 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_group_command (yyvsp[-1].command); ;
break;}
case 89:
#line 806 "/Users/chet/src/bash/src/parse.y"
#line 806 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_arith_command (yyvsp[0].word_list); ;
break;}
case 90:
#line 810 "/Users/chet/src/bash/src/parse.y"
#line 810 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[-1].command; ;
break;}
case 91:
#line 814 "/Users/chet/src/bash/src/parse.y"
#line 814 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_if_command (yyvsp[-2].command, yyvsp[0].command, (COMMAND *)NULL); ;
break;}
case 92:
#line 816 "/Users/chet/src/bash/src/parse.y"
#line 816 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_if_command (yyvsp[-4].command, yyvsp[-2].command, yyvsp[0].command); ;
break;}
case 93:
#line 818 "/Users/chet/src/bash/src/parse.y"
#line 818 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = make_if_command (yyvsp[-3].command, yyvsp[-1].command, yyvsp[0].command); ;
break;}
case 95:
#line 823 "/Users/chet/src/bash/src/parse.y"
#line 823 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyvsp[0].pattern->next = yyvsp[-1].pattern; yyval.pattern = yyvsp[0].pattern; ;
break;}
case 96:
#line 827 "/Users/chet/src/bash/src/parse.y"
#line 827 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.pattern = make_pattern_list (yyvsp[-2].word_list, yyvsp[0].command); ;
break;}
case 97:
#line 829 "/Users/chet/src/bash/src/parse.y"
#line 829 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.pattern = make_pattern_list (yyvsp[-2].word_list, (COMMAND *)NULL); ;
break;}
case 98:
#line 831 "/Users/chet/src/bash/src/parse.y"
#line 831 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.pattern = make_pattern_list (yyvsp[-2].word_list, yyvsp[0].command); ;
break;}
case 99:
#line 833 "/Users/chet/src/bash/src/parse.y"
#line 833 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.pattern = make_pattern_list (yyvsp[-2].word_list, (COMMAND *)NULL); ;
break;}
case 101:
#line 838 "/Users/chet/src/bash/src/parse.y"
#line 838 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyvsp[-1].pattern->next = yyvsp[-2].pattern; yyval.pattern = yyvsp[-1].pattern; ;
break;}
case 102:
#line 842 "/Users/chet/src/bash/src/parse.y"
#line 842 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.word_list = make_word_list (yyvsp[0].word, (WORD_LIST *)NULL); ;
break;}
case 103:
#line 844 "/Users/chet/src/bash/src/parse.y"
#line 844 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.word_list = make_word_list (yyvsp[0].word, yyvsp[-2].word_list); ;
break;}
case 104:
#line 853 "/Users/chet/src/bash/src/parse.y"
#line 853 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = yyvsp[0].command;
if (need_here_doc)
@@ -1945,13 +1945,13 @@ case 104:
;
break;}
case 106:
#line 862 "/Users/chet/src/bash/src/parse.y"
#line 862 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = yyvsp[0].command;
;
break;}
case 108:
#line 869 "/Users/chet/src/bash/src/parse.y"
#line 869 "/usr/src/local/chet/src/bash/src/parse.y"
{
if (yyvsp[-2].command->type == cm_connection)
yyval.command = connect_async_list (yyvsp[-2].command, (COMMAND *)NULL, '&');
@@ -1960,15 +1960,15 @@ case 108:
;
break;}
case 110:
#line 880 "/Users/chet/src/bash/src/parse.y"
#line 880 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = command_connect (yyvsp[-3].command, yyvsp[0].command, AND_AND); ;
break;}
case 111:
#line 882 "/Users/chet/src/bash/src/parse.y"
#line 882 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = command_connect (yyvsp[-3].command, yyvsp[0].command, OR_OR); ;
break;}
case 112:
#line 884 "/Users/chet/src/bash/src/parse.y"
#line 884 "/usr/src/local/chet/src/bash/src/parse.y"
{
if (yyvsp[-3].command->type == cm_connection)
yyval.command = connect_async_list (yyvsp[-3].command, yyvsp[0].command, '&');
@@ -1977,31 +1977,31 @@ case 112:
;
break;}
case 113:
#line 891 "/Users/chet/src/bash/src/parse.y"
#line 891 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = command_connect (yyvsp[-3].command, yyvsp[0].command, ';'); ;
break;}
case 114:
#line 893 "/Users/chet/src/bash/src/parse.y"
#line 893 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = command_connect (yyvsp[-3].command, yyvsp[0].command, ';'); ;
break;}
case 115:
#line 895 "/Users/chet/src/bash/src/parse.y"
#line 895 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 118:
#line 903 "/Users/chet/src/bash/src/parse.y"
#line 903 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.number = '\n'; ;
break;}
case 119:
#line 905 "/Users/chet/src/bash/src/parse.y"
#line 905 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.number = ';'; ;
break;}
case 120:
#line 907 "/Users/chet/src/bash/src/parse.y"
#line 907 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.number = yacc_EOF; ;
break;}
case 123:
#line 921 "/Users/chet/src/bash/src/parse.y"
#line 921 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = yyvsp[0].command;
if (need_here_doc)
@@ -2009,7 +2009,7 @@ case 123:
;
break;}
case 124:
#line 927 "/Users/chet/src/bash/src/parse.y"
#line 927 "/usr/src/local/chet/src/bash/src/parse.y"
{
if (yyvsp[-1].command->type == cm_connection)
yyval.command = connect_async_list (yyvsp[-1].command, (COMMAND *)NULL, '&');
@@ -2020,7 +2020,7 @@ case 124:
;
break;}
case 125:
#line 936 "/Users/chet/src/bash/src/parse.y"
#line 936 "/usr/src/local/chet/src/bash/src/parse.y"
{
yyval.command = yyvsp[-1].command;
if (need_here_doc)
@@ -2028,15 +2028,15 @@ case 125:
;
break;}
case 126:
#line 944 "/Users/chet/src/bash/src/parse.y"
#line 944 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = command_connect (yyvsp[-3].command, yyvsp[0].command, AND_AND); ;
break;}
case 127:
#line 946 "/Users/chet/src/bash/src/parse.y"
#line 946 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = command_connect (yyvsp[-3].command, yyvsp[0].command, OR_OR); ;
break;}
case 128:
#line 948 "/Users/chet/src/bash/src/parse.y"
#line 948 "/usr/src/local/chet/src/bash/src/parse.y"
{
if (yyvsp[-2].command->type == cm_connection)
yyval.command = connect_async_list (yyvsp[-2].command, yyvsp[0].command, '&');
@@ -2045,19 +2045,19 @@ case 128:
;
break;}
case 129:
#line 955 "/Users/chet/src/bash/src/parse.y"
#line 955 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = command_connect (yyvsp[-2].command, yyvsp[0].command, ';'); ;
break;}
case 130:
#line 958 "/Users/chet/src/bash/src/parse.y"
#line 958 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 131:
#line 962 "/Users/chet/src/bash/src/parse.y"
#line 962 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 132:
#line 964 "/Users/chet/src/bash/src/parse.y"
#line 964 "/usr/src/local/chet/src/bash/src/parse.y"
{
if (yyvsp[0].command)
yyvsp[0].command->flags |= CMD_INVERT_RETURN;
@@ -2065,7 +2065,7 @@ case 132:
;
break;}
case 133:
#line 970 "/Users/chet/src/bash/src/parse.y"
#line 970 "/usr/src/local/chet/src/bash/src/parse.y"
{
if (yyvsp[0].command)
yyvsp[0].command->flags |= yyvsp[-1].number;
@@ -2073,7 +2073,7 @@ case 133:
;
break;}
case 134:
#line 976 "/Users/chet/src/bash/src/parse.y"
#line 976 "/usr/src/local/chet/src/bash/src/parse.y"
{
if (yyvsp[0].command)
yyvsp[0].command->flags |= yyvsp[-2].number|CMD_INVERT_RETURN;
@@ -2081,7 +2081,7 @@ case 134:
;
break;}
case 135:
#line 982 "/Users/chet/src/bash/src/parse.y"
#line 982 "/usr/src/local/chet/src/bash/src/parse.y"
{
if (yyvsp[0].command)
yyvsp[0].command->flags |= yyvsp[-1].number|CMD_INVERT_RETURN;
@@ -2089,7 +2089,7 @@ case 135:
;
break;}
case 136:
#line 988 "/Users/chet/src/bash/src/parse.y"
#line 988 "/usr/src/local/chet/src/bash/src/parse.y"
{
ELEMENT x;
@@ -2108,19 +2108,19 @@ case 136:
;
break;}
case 137:
#line 1009 "/Users/chet/src/bash/src/parse.y"
#line 1009 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = command_connect (yyvsp[-3].command, yyvsp[0].command, '|'); ;
break;}
case 138:
#line 1011 "/Users/chet/src/bash/src/parse.y"
#line 1011 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.command = yyvsp[0].command; ;
break;}
case 139:
#line 1015 "/Users/chet/src/bash/src/parse.y"
#line 1015 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.number = CMD_TIME_PIPELINE; ;
break;}
case 140:
#line 1017 "/Users/chet/src/bash/src/parse.y"
#line 1017 "/usr/src/local/chet/src/bash/src/parse.y"
{ yyval.number = CMD_TIME_PIPELINE|CMD_TIME_POSIX; ;
break;}
}
@@ -2345,7 +2345,7 @@ yyerrhandle:
}
return 1;
}
#line 1019 "/Users/chet/src/bash/src/parse.y"
#line 1019 "/usr/src/local/chet/src/bash/src/parse.y"
/* Possible states for the parser that require it to do special things. */
@@ -3206,7 +3206,7 @@ shell_getc (remove_quoted_newline)
if (sigwinch_received)
{
sigwinch_received = 0;
get_new_window_size (0);
get_new_window_size (0, (int *)0, (int *)0);
}
if (eol_ungetc_lookahead)