commit bash-20040108 snapshot

This commit is contained in:
Chet Ramey
2011-12-03 12:53:09 -05:00
parent 5e13499c55
commit 545f34cfd4
34 changed files with 75981 additions and 5820 deletions
+2
View File
@@ -1,6 +1,8 @@
#
# Master author manifest for bash
#
# The files in lib/intl were taken from the GNU gettext distribution.
#
# Any files appearing in the bash distribution not listed in this file
# were created by Chet Ramey.
#
+454
View File
@@ -0,0 +1,454 @@
#
# Master author manifest for bash
#
# Any files appearing in the bash distribution not listed in this file
# were created by Chet Ramey.
#
# Filename authors (first is original author)
#
README Brian Fox, Chet Ramey
INSTALL Brian Fox, Chet Ramey
COPYING Brian Fox, Chet Ramey
MANIFEST Brian Fox, Chet Ramey
configure Chet Ramey
Makefile.in Brian Fox, Chet Ramey
configure.in Chet Ramey
aclocal.m4 Chet Ramey
config.h.top Chet Ramey
config.h.bot Chet Ramey
config.h.in Chet Ramey
array.c Chet Ramey
print_cmd.c Brian Fox, Chet Ramey
general.c Brian Fox, Chet Ramey
variables.c Brian Fox, Chet Ramey
make_cmd.c Brian Fox, Chet Ramey
copy_cmd.c Brian Fox, Chet Ramey
unwind_prot.c Brian Fox, Chet Ramey
dispose_cmd.c Brian Fox, Chet Ramey
getcwd.c Roland McGrath, Brian Fox, Chet Ramey
bashhist.c Chet Ramey
hash.c Brian Fox, Chet Ramey
parse.y Brian Fox, Chet Ramey
subst.c Brian Fox, Chet Ramey
shell.c Brian Fox, Chet Ramey
sig.c Chet Ramey
trap.c Brian Fox, Chet Ramey
siglist.c Brian Fox, Chet Ramey
version.c Brian Fox, Chet Ramey
flags.c Brian Fox, Chet Ramey
jobs.c Brian Fox, Chet Ramey
input.c Chet Ramey
mailcheck.c Brian Fox, Chet Ramey
pathexp.c Chet Ramey
test.c Brian Fox, Chet Ramey
expr.c Chet Ramey, Brian Fox
alias.c Brian Fox, Chet Ramey
execute_cmd.c Brian Fox, Chet Ramey
bashline.c Brian Fox, Chet Ramey
braces.c Brian Fox, Chet Ramey
bracecomp.c Brian Fox, Chet Ramey, Tom Tromey
nojobs.c Brian Fox, Chet Ramey
vprint.c Chet Ramey
oslib.c Chet Ramey
error.c Brian Fox, Chet Ramey
xmalloc.c Brian Fox, Chet Ramey
alias.h Brian Fox, Chet Ramey
array.h Chet Ramey
builtins.h Brian Fox, Chet Ramey
parser.h Brian Fox, Chet Ramey
variables.h Brian Fox, Chet Ramey
machines.h Brian Fox, Chet Ramey
jobs.h Brian Fox, Chet Ramey
maxpath.h Brian Fox, Chet Ramey
pathexp.h Chet Ramey
mailcheck.h Chet Ramey
filecntl.h Brian Fox, Chet Ramey
hash.h Brian Fox, Chet Ramey
quit.h Brian Fox, Chet Ramey
flags.h Brian Fox, Chet Ramey
shell.h Brian Fox, Chet Ramey
bashjmp.h Chet Ramey
sig.h Chet Ramey
trap.h Brian Fox, Chet Ramey
general.h Brian Fox, Chet Ramey
unwind_prot.h Brian Fox, Chet Ramey
input.h Brian Fox, Chet Ramey
error.h Brian Fox, Chet Ramey
command.h Brian Fox, Chet Ramey
externs.h Chet Ramey
siglist.h Chet Ramey
subst.h Brian Fox, Chet Ramey
dispose_cmd.h Brian Fox, Chet Ramey
bashansi.h Brian Fox, Chet Ramey
make_cmd.h Brian Fox, Chet Ramey
bashhist.h Chet Ramey
bashline.h Chet Ramey
execute_cmd.h Chet Ramey
bashtypes.h Chet Ramey
bashtty.h Chet Ramey
pathnames.h Chet Ramey
y.tab.c Brian Fox, Chet Ramey
y.tab.h Brian Fox, Chet Ramey
parser-built Brian Fox, Chet Ramey
posixstat.h Brian Fox, Chet Ramey
stdc.h Chet Ramey
ansi_stdlib.h Brian Fox, Chet Ramey
memalloc.h Chet Ramey
builtins/ChangeLog Brian Fox, Chet Ramey
builtins/Makefile.in Brian Fox, Chet Ramey
builtins/alias.def Brian Fox, Chet Ramey
builtins/bind.def Brian Fox, Chet Ramey
builtins/break.def Brian Fox, Chet Ramey
builtins/builtin.def Brian Fox, Chet Ramey
builtins/caller.def Rocky Bernstein, Chet Ramey
builtins/cd.def Brian Fox, Chet Ramey
builtins/colon.def Brian Fox, Chet Ramey
builtins/command.def Brian Fox, Chet Ramey
builtins/common.c Brian Fox, Chet Ramey
builtins/declare.def Brian Fox, Chet Ramey
builtins/echo.def Brian Fox, Chet Ramey
builtins/enable.def Brian Fox, Chet Ramey
builtins/eval.def Brian Fox, Chet Ramey
builtins/exec.def Brian Fox, Chet Ramey
builtins/exit.def Brian Fox, Chet Ramey
builtins/fc.def Brian Fox, Chet Ramey
builtins/fg_bg.def Brian Fox, Chet Ramey
builtins/getopt.c Roland McGrath, Brian Fox, Chet Ramey
builtins/getopt.h Roland McGrath, Brian Fox, Chet Ramey
builtins/getopts.def Brian Fox, Chet Ramey
builtins/hash.def Brian Fox, Chet Ramey
builtins/hashcom.h Brian Fox, Chet Ramey
builtins/help.def Brian Fox, Chet Ramey
builtins/let.def Chet Ramey, Brian Fox
builtins/history.def Brian Fox, Chet Ramey
builtins/jobs.def Brian Fox, Chet Ramey
builtins/kill.def Brian Fox, Chet Ramey
builtins/mkbuiltins.c Brian Fox, Chet Ramey
builtins/pushd.def Brian Fox, Chet Ramey
builtins/read.def Brian Fox, Chet Ramey
builtins/reserved.def Brian Fox, Chet Ramey
builtins/return.def Brian Fox, Chet Ramey
builtins/set.def Brian Fox, Chet Ramey
builtins/setattr.def Brian Fox, Chet Ramey
builtins/shift.def Brian Fox, Chet Ramey
builtins/shopt.def Chet Ramey
builtins/source.def Brian Fox, Chet Ramey
builtins/suspend.def Brian Fox, Chet Ramey
builtins/test.def Brian Fox, Chet Ramey
builtins/times.def Brian Fox, Chet Ramey
builtins/trap.def Brian Fox, Chet Ramey
builtins/type.def Brian Fox, Chet Ramey
builtins/ulimit.def Chet Ramey, Brian Fox
builtins/umask.def Brian Fox, Chet Ramey
builtins/wait.def Brian Fox, Chet Ramey
builtins/psize.c Chet Ramey, Brian Fox
builtins/psize.sh Chet Ramey, Brian Fox
builtins/inlib.def Chet Ramey
builtins/bashgetopt.c Chet Ramey
builtins/common.h Chet Ramey
builtins/bashgetopt.h Chet Ramey
lib/doc-support/texindex.c bug-texinfo@prep.ai.mit.edu, Chet Ramey
lib/doc-support/Makefile.in Chet Ramey
lib/doc-support/getopt.h Roland McGrath
lib/doc-support/getopt.c Roland McGrath
lib/doc-support/getopt1.c Roland McGrath
lib/glob/ChangeLog Brian Fox, Chet Ramey
lib/glob/Makefile.in Brian Fox, Chet Ramey
lib/glob/strmatch.c Roland McGrath, Brian Fox, Chet Ramey
lib/glob/strmatch.h Roland McGrath, Brian Fox, Chet Ramey
lib/glob/glob.c Richard Stallman, Roland McGrath, Brian Fox, Chet Ramey
lib/glob/glob.h Chet Ramey
lib/glob/ndir.h Doug Gwyn, Richard Stallman
lib/glob/doc/Makefile.in Brian Fox, Chet Ramey
lib/glob/doc/glob.texi Brian Fox, Chet Ramey
lib/malloc/Makefile.in Chet Ramey
lib/malloc/alloca.c Doug Gwyn, Richard Stallman, Brian Fox, Chet Ramey
lib/malloc/getpagesize.h Brian Fox, Chet Ramey
lib/malloc/malloc.c Chris Kingsley, Mike Muuss, Richard Stallman, Brian Fox, Chet Ramey
lib/malloc/gmalloc.c Mike Haertel, Roland McGrath
lib/malloc/stub.c Chet Ramey
lib/malloc/i386-alloca.s Richard Stallman
lib/malloc/x386-alloca.s Chip Salzenberg, Richard Stallman
lib/malloc/xmalloc.c Brian Fox, Chet Ramey
lib/posixheaders/posixstat.h Brian Fox, Chet Ramey
lib/posixheaders/ansi_stdlib.h Brian Fox, Chet Ramey
lib/posixheaders/stdc.h Chet Ramey
lib/posixheaders/memalloc.h Chet Ramey
lib/posixheaders/filecntl.h Brian Fox, Chet Ramey
lib/readline/Makefile.in Brian Fox, Chet Ramey
lib/readline/COPYING Brian Fox, Chet Ramey
lib/readline/ChangeLog Brian Fox, Chet Ramey
lib/readline/readline.c Brian Fox, Chet Ramey
lib/readline/vi_mode.c Brian Fox, Chet Ramey
lib/readline/emacs_keymap.c Brian Fox, Chet Ramey
lib/readline/vi_keymap.c Brian Fox, Chet Ramey
lib/readline/funmap.c Brian Fox, Chet Ramey
lib/readline/keymaps.c Brian Fox, Chet Ramey
lib/readline/xmalloc.c Brian Fox, Chet Ramey
lib/readline/search.c Brian Fox, Chet Ramey
lib/readline/isearch.c Brian Fox, Chet Ramey
lib/readline/parens.c Brian Fox, Chet Ramey
lib/readline/rltty.c Brian Fox, Chet Ramey
lib/readline/complete.c Brian Fox, Chet Ramey
lib/readline/bind.c Brian Fox, Chet Ramey
lib/readline/display.c Brian Fox, Chet Ramey
lib/readline/signals.c Brian Fox, Chet Ramey
lib/readline/kill.c Brian Fox, Chet Ramey
lib/readline/undo.c Brian Fox, Chet Ramey
lib/readline/input.c Brian Fox, Chet Ramey
lib/readline/macro.c Brian Fox, Chet Ramey
lib/readline/util.c Brian Fox, Chet Ramey
lib/readline/callback.c Chet Ramey
lib/readline/readline.h Brian Fox, Chet Ramey
lib/readline/chardefs.h Brian Fox, Chet Ramey
lib/readline/keymaps.h Brian Fox, Chet Ramey
lib/readline/rldefs.h Brian Fox, Chet Ramey
lib/readline/posixstat.h Brian Fox, Chet Ramey
lib/readline/ansi_stdlib.h Brian Fox, Chet Ramey
lib/readline/memalloc.h Chet Ramey
lib/readline/rlconf.h Chet Ramey
lib/readline/rltty.h Chet Ramey
lib/readline/history.c Brian Fox, Chet Ramey
lib/readline/histexpand.c Brian Fox, Chet Ramey
lib/readline/histfile.c Brian Fox, Chet Ramey
lib/readline/histsearch.c Brian Fox, Chet Ramey
lib/readline/history.h Brian Fox, Chet Ramey
lib/readline/histlib.h Brian Fox, Chet Ramey
lib/readline/tilde.c Brian Fox, Chet Ramey
lib/readline/tilde.h Brian Fox, Chet Ramey
lib/readline/doc/texindex.c bug-texinfo@prep.ai.mit.edu, Chet Ramey
lib/readline/doc/Makefile Brian Fox, Chet Ramey
lib/readline/doc/rlman.texinfo Brian Fox, Chet Ramey
lib/readline/doc/rltech.texinfo Brian Fox, Chet Ramey
lib/readline/doc/rluser.texinfo Brian Fox, Chet Ramey
lib/readline/doc/hist.texinfo Brian Fox, Chet Ramey
lib/readline/doc/hstech.texinfo Brian Fox, Chet Ramey
lib/readline/doc/hsuser.texinfo Brian Fox, Chet Ramey
lib/readline/examples/Makefile Brian Fox
lib/readline/examples/fileman.c Brian Fox
lib/readline/examples/manexamp.c Brian Fox
lib/readline/examples/histexamp.c Brian Fox, Chet Ramey
lib/readline/examples/rltest.c Brian Fox, Chet Ramey
lib/readline/examples/Inputrc Brian Fox, Chet Ramey
lib/termcap/Makefile.in David MacKenzie, Chet Ramey
lib/termcap/termcap.c David MacKenzie
lib/termcap/termcap.h David MacKenzie
lib/termcap/tparam.c David MacKenzie
lib/termcap/version.c David MacKenzie
lib/termcap/grot/termcap.info David MacKenzie
lib/termcap/grot/termcap.info-1 David MacKenzie
lib/termcap/grot/termcap.info-2 David MacKenzie
lib/termcap/grot/termcap.info-3 David MacKenzie
lib/termcap/grot/termcap.info-4 David MacKenzie
lib/termcap/grot/NEWS David MacKenzie
lib/termcap/grot/INSTALL David MacKenzie
lib/termcap/grot/ChangeLog David MacKenzie
lib/termcap/grot/texinfo.tex David MacKenzie
lib/termcap/grot/termcap.texi David MacKenzie
lib/termcap/grot/Makefile.in David MacKenzie
lib/termcap/grot/configure David MacKenzie
lib/termcap/grot/configure.in David MacKenzie
lib/termcap/grot/COPYING David MacKenzie
lib/termcap/grot/README David MacKenzie
lib/tilde/ChangeLog Brian Fox, Chet Ramey
lib/tilde/Makefile.in Brian Fox, Chet Ramey
lib/tilde/doc/tilde.texi Brian Fox, Chet Ramey
lib/tilde/doc/Makefile Brian Fox, Chet Ramey
lib/tilde/tilde.c Brian Fox, Chet Ramey
lib/tilde/tilde.h Brian Fox, Chet Ramey
lib/tilde/memalloc.h Brian Fox, Chet Ramey
CWRU/misc/open-files.c Chet Ramey
CWRU/misc/sigs.c Chet Ramey
CWRU/misc/pid.c Chet Ramey
CWRU/misc/sigstat.c Chet Ramey
CWRU/misc/bison Chet Ramey
CWRU/misc/aux-machine-desc Chet Ramey
CWRU/PLATFORMS Chet Ramey
CWRU/README Chet Ramey
CWRU/CWRU.CHANGES.051093 Chet Ramey
CWRU/POSIX.NOTES Chet Ramey
CWRU/CWRU.CHANGES.071193 Chet Ramey
CWRU/CWRU.CHANGES.090393 Chet Ramey
doc/Makefile.in Brian Fox, Chet Ramey
doc/bash.1 Chet Ramey
doc/builtins.1 Chet Ramey
doc/bash.ps Chet Ramey
doc/bash.txt Chet Ramey
doc/readline.3 Chet Ramey
doc/readline.ps Chet Ramey
doc/readline.txt Chet Ramey
doc/texinfo.tex Richard Stallman
doc/features.texi Brian Fox, Chet Ramey
doc/features.ps Brian Fox, Chet Ramey
doc/features.info Brian Fox, Chet Ramey
doc/features.dvi Brian Fox, Chet Ramey
doc/bash_builtins.1 Chet Ramey
doc/bash_builtins.ps Chet Ramey
doc/bash_builtins.txt Chet Ramey
doc/bash_builtins.readme Chet Ramey
doc/article.ms Chet Ramey
doc/FAQ Chet Ramey
support/cat-s Brian Fox, Chet Ramey
support/mksysdefs Brian Fox, Chet Ramey
support/mkversion.c Brian Fox, Chet Ramey
support/mksignames.c Brian Fox, Chet Ramey
support/getcppsyms.c Brian Fox, Chet Ramey
support/cppmagic Brian Fox, Chet Ramey
support/pagesize.sh Chet Ramey, Brian Fox
support/pagesize.c Chet Ramey, Brian Fox
support/bash.xbm Brian Fox
support/FAQ Brian Fox
support/PORTING Brian Fox
support/mklinks Brian Fox
support/fixlinks Chet Ramey
support/mkdirs Chet Ramey
support/clone-bash Chet Ramey
support/bashbug.sh Chet Ramey
support/mkmachtype Chet Ramey
support/recho.c Chet Ramey
support/config.guess Per Bothner, Chet Ramey
support/config.sub Richard Stallman, Chet Ramey
support/install.sh MIT X Consortium (X11R5)
support/endian.c Chet Ramey
support/printenv Chet Ramey
examples/precedence-tester Brian Fox, Chet Ramey
examples/functions/substr Brian Fox, Chet Ramey
examples/functions/kshenv Chet Ramey
examples/functions/autoload Chet Ramey
examples/functions/csh-compat Brian Fox, Chet Ramey
examples/functions/shcat Chet Ramey
examples/functions/substr2 Chet Ramey
examples/functions/term Chet Ramey
examples/functions/whatis Chet Ramey
examples/functions/whence Chet Ramey
examples/functions/func Chet Ramey
examples/functions/dirname Brian Fox, Noah Friedman
examples/functions/basename Brian Fox, Noah Friedman
examples/functions/exitstat Noah Friedman, Roland McGrath
examples/functions/external Noah Friedman
examples/functions/fact Brian Fox
examples/functions/manpage Tom Tromey
examples/functions/fstty Chet Ramey
examples/functions/jj.bash Chet Ramey
examples/functions/notify.bash Chet Ramey
examples/scripts/shprompt Chet Ramey
examples/scripts/adventure.sh Chet Ramey, Doug Gwyn
examples/scripts/bcsh.sh Chris Robertson, Chet Ramey
examples/startup-files/Bashrc Brian Fox
examples/startup-files/Bash_aliases Brian Fox
examples/startup-files/Bash_profile Brian Fox
examples/startup-files/bash-profile Brian Fox
examples/startup-files/bashrc Chet Ramey
examples/suncmd.termcap Brian Fox, Chet Ramey
examples/alias-conv.sh Brian Fox, Chet Ramey
tests/README Chet Ramey
tests/arith.tests Chet Ramey
tests/arith.right Chet Ramey
tests/array.tests Chet Ramey
tests/array.right Chet Ramey
tests/dollar-at.sh Chet Ramey
tests/dollar-star.sh Chet Ramey
tests/dollar.right Chet Ramey
tests/exp-tests Chet Ramey
tests/exp.right Chet Ramey
tests/glob-test Chet Ramey
tests/glob.right Chet Ramey
tests/ifs-test-1.sh Chet Ramey
tests/ifs-test-2.sh Chet Ramey
tests/ifs-test-3.sh Chet Ramey
tests/ifs.1.right Chet Ramey
tests/ifs.2.right Chet Ramey
tests/ifs.3.right Chet Ramey
tests/input-line.sh Chet Ramey
tests/input-line.sub Chet Ramey
tests/input.right Chet Ramey
tests/minus-e Chet Ramey
tests/minus-e.right Chet Ramey
tests/new-exp.tests Chet Ramey
tests/new-exp.right Chet Ramey
tests/prec.right Chet Ramey
tests/precedence Chet Ramey
tests/run-all Chet Ramey
tests/run-dollars Chet Ramey
tests/run-exp-tests Chet Ramey
tests/run-glob-test Chet Ramey
tests/run-ifs-tests Chet Ramey
tests/run-input-test Chet Ramey
tests/run-minus-e Chet Ramey
tests/run-new-exp Chet Ramey
tests/run-precedence Chet Ramey
tests/run-set-e-test Chet Ramey
tests/run-strip Chet Ramey
tests/run-varenv Chet Ramey
tests/set-e-test Chet Ramey
tests/set-e.right Chet Ramey
tests/strip.tests Chet Ramey
tests/strip.right Chet Ramey
tests/tilde-tests Chet Ramey
tests/tilde.right Chet Ramey
tests/varenv.right Chet Ramey
tests/varenv.sh Chet Ramey
tests/misc/chld-trap.sh Chet Ramey
tests/misc/dot-test-1.sh Chet Ramey
tests/misc/dot-test-1.sub Chet Ramey
tests/misc/gotest Chet Ramey
tests/misc/perf-script Chet Ramey
tests/misc/redir.t1.sh Chet Ramey
tests/misc/redir.t2.sh Chet Ramey
tests/misc/redir.t3.sh Chet Ramey
tests/misc/redir.t3.sub Chet Ramey
tests/misc/redir.t4.sh Chet Ramey
tests/misc/run.r1.sh Chet Ramey
tests/misc/run.r2.sh Chet Ramey
tests/misc/run.r3.sh Chet Ramey
tests/misc/sigint.t1.sh Chet Ramey
tests/misc/sigint.t2.sh Chet Ramey
tests/misc/sigint.t3.sh Chet Ramey
tests/misc/sigint.t4.sh Chet Ramey
tests/misc/test-minus-e.1 Chet Ramey
tests/misc/test-minus-e.2 Chet Ramey
lib/sh/Makefile.in Chet Ramey
lib/sh/clktck.c Chet Ramey
lib/sh/clock.c Chet Ramey
lib/sh/fmtullong.c Chet Ramey
lib/sh/fmtulong.c Chet Ramey
lib/sh/getcwd.c Chet Ramey, Roland McGrath
lib/sh/getenv.c Chet Ramey, Brian Fox
lib/sh/inet_aton.c Chet Ramey, Ulrich Drepper, Paul Vixie
lib/sh/itos.c Chet Ramey
lib/sh/mailstat.c Chet Ramey
lib/sh/makepath.c Chet Ramey
lib/sh/mktime.c Chet Ramey, Paul Eggert
lib/sh/netconn.c Chet Ramey
lib/sh/netopen.c Chet Ramey
lib/sh/oslib.c Chet Ramey, Brian Fox
lib/sh/pathcanon.c Chet Ramey
lib/sh/pathphys.c Chet Ramey
lib/sh/rename.c Chet Ramey
lib/sh/setlinebuf.c Chet Ramey, Brian Fox
lib/sh/shquote.c Chet Ramey
lib/sh/shtty.c Chet Ramey
lib/sh/snprintf.c Chet Ramey, Unknown
lib/sh/spell.c Chet Ramey
lib/sh/strcasecmp.c Chet Ramey, Brian Fox
lib/sh/strerror.c Chet Ramey, Brian Fox
lib/sh/strftime.c Arnold Robbins
lib/sh/strindex.c Chet Ramey
lib/sh/stringlist.c Chet Ramey
lib/sh/stringvec.c Chet Ramey
lib/sh/strpbrk.c Roland McGrath
lib/sh/strtod.c Chet Ramey, Roland McGrath
lib/sh/strtoimax.c Chet Ramey, Paul Eggert
lib/sh/strtol.c Chet Ramey, Paul Eggert
lib/sh/strtoll.c Chet Ramey, Paul Eggert
lib/sh/strtoul.c Chet Ramey, Paul Eggert
lib/sh/strtoull.c Chet Ramey, Paul Eggert
lib/sh/strtoumax.c Chet Ramey, Paul Eggert
lib/sh/strtrans.c Chet Ramey
lib/sh/times.c Chet Ramey, Brian Fox
lib/sh/timeval.c Chet Ramey
lib/sh/tmpfile.c Chet Ramey
lib/sh/vprint.c Chet Ramey, Brian Fox
lib/sh/xstrchr.c Chet Ramey, Mitsuru Chinen
lib/sh/zread.c Chet Ramey
lib/sh/zwrite.c Chet Ramey
+109
View File
@@ -3,6 +3,115 @@ and the previous version, bash-2.05b-release.
1. Changes to Bash
a. Fixes to build correctly when arrays are not compiled into the shell.
b. Fixed command substitution to run any exit trap defined in the command
substitution before returning; the exit trap is not inherited from the
calling shell.
c. Fixes to process group synchronization code so that every child process
attempts to set the terminal's process group; fixes some synchronization
problems on Linux kernels that schedule the child to always run before
the parent.
d. Fixed processing of octal and hex constants in printf builtin for POSIX.2
compliance.
e. Fixed a couple of core dumps in the pattern removal code.
f. Fixes to the array subrange extraction code to deal better with sparse
arrays.
g. Parser errors and other errors that result in the shell exiting now cause
the exit trap to be run.
h. Change the command substitution completion functions to not append any
closing quote, because it would be inserted a closing "`" or ")".
i. Fix history initialization so assignments to $histchars made in startup
files are honored.
j. If an exit trap does not contain a call to `exit', the shell now uses
the exit status of the last command executed before the trap as the exit
status of the shell.
k. The parser now prompts with $PS2 if it reads a newline while parsing a
compound array assignment statement.
l. When performing a compound array assignment, the parser doesn't treat
words of the form [index]=value as assignments if they're the result of
expansions.
m. Fixed a bug that caused `return' executed in a trap command to make the
shell think it was still running the trap.
n. Fixed the value of errno set by the pathname canonicalization functions.
o. Changed the grammar so that `time' alone on a line times a null command
rather than being a syntax error.
p. The pattern substitution coded no longer performs quote removal on the
pattern before trying to match it, as the pattern removal functions do.
q. Fixed a bug that could cause core dumps when checking whether a quoted
command name was being completed.
r. Fixes to the pattern removal and pattern replacement expansions to deal
with multibyte characters better.
s. Fix to the substring expansion (${param:off[:len]}) to deal with (possibly
multibyte) characters instead of raw bytes.
2. Changes to Readline
a. Change to history expansion functions to treat `^' as equivalent to word
one, as the documention states.
b. Some changes to the display code to improve display and redisplay of
multibyte characters.
c. Changes to speed up the multibyte character redisplay code.
d. Fixed a bug in the vi-mode `E' command that caused it to skip over the
last character of a word if invoked while point was on the word's
next-to-last character.
e. Fixed a bug that could cause incorrect filename quoting when
case-insensitive completion was enabled and the word being completed
contained backslashes quoting word break characters.
f. Fixed a bug in redisplay triggered when the prompt string contains
invisible characters.
3. New Features in Bash
a. printf builtin understands two new escape sequences: \" and \?.
b. `echo -e' understands two new escape sequences: \" and \?.
c. The GNU `gettext' package and libintl have been integrated; the shell's
messages can be translated into different languages.
4. New Features in Readline
a. New application variable, rl_completion_quote_character, set to any
quote character readline finds before it calls the application completion
function.
b. New application variable, rl_completion_suppress_quote, settable by an
application completion function. If set to non-zero, readline does not
attempt to append a closing quote to a completed word.
c. New application variable, rl_completion_found_quote, set to a non-zero
value if readline determines that the word to be completed is quoted.
Set before readline calls any application completion function.
------------------------------------------------------------------------------
This document details the changes between this version, bash-3.0-alpha,
and the previous version, bash-2.05b-release.
1. Changes to Bash
a. Fixes so that the shell will compile without some of the default options
defined.
+4517
View File
File diff suppressed because it is too large Load Diff
+48
View File
@@ -8916,3 +8916,51 @@ lib/readline/complete.c
lib/readline/readline.h
- extern declaration for rl_completion_found_quote
1/8
---
lib/readline/doc/rltech.texi
- documented rl_completion_found_quote
lib/readline/complete.c
- in compute_lcd_of_matches, if it looks like what the user typed was
dequoted before generating filename matches, dequote the user's
text again before figuring out the case-insensitive lcd
1/9
---
lib/readline/display.c
- fix from Edward Catmur <ed@catmur.co.uk> to logic that handles
invisible characters in prompt string. Original code was wrong
about local_prompt_prefix; it gave incorrect results when prompt
contained invisible characters after a line break
1/10
----
subst.c
- new function, mb_substring(), does character (possibly multibyte)
oriented rather than strictly byte-oriented substring extraction.
The passed indices, rather than strictly indexing into the string,
indicate character positions that need to be calculated. From
Tim Waugh <twaugh@redhat.com>
- change parameter_brace_substring to use mb_substring if necessary
included/shmbutil.h
- new define SADD_MBQCHAR_BODY, common code for adding a quoted
(preceded by CTLESC) multibyte character to an accumulating string
in the subst.c expansion code
subst.c
- use SADD_MBQCHAR_BODY in expand_word_internal
- new static function, mb_getcharlens, allocates and returns an array
of character lengths for (possibly multibyte) characters in the
argument string
- change pattern matching operations to use while loops instead of
for loops to handle multibyte characters better (no more simple
increment or decrement)
- change pattern matching operations to use multibyte character
operations instead of simple increments and decrements. Don't
use BACKUP_CHAR_P -- use the mblen array instead, because that
avoids the N**2 behavior of having to count from the beginning
of the string each time you want to back up one character. Changes
to remove_pattern and match_pattern
+8964
View File
File diff suppressed because it is too large Load Diff
+19
View File
@@ -115,6 +115,13 @@ gg. New `set -o pipefail' option that causes a pipeline to return a failure
status if any of the processes in the pipeline fail, not just the last
one.
hh. printf builtin understands two new escape sequences: \" and \?.
ii. `echo -e' understands two new escape sequences: \" and \?.
jj. The GNU `gettext' package and libintl have been integrated; the shell's
messages can be translated into different languages.
2. New Features in Readline
a. History expansion has a new `a' modifier equivalent to the `g' modifier
@@ -146,6 +153,18 @@ h. Four new key binding functions have been added:
rl_bind_keyseq_if_unbound()
rl_bind_keyseq_if_unbound_in_map()
i. New application variable, rl_completion_quote_character, set to any
quote character readline finds before it calls the application completion
function.
j. New application variable, rl_completion_suppress_quote, settable by an
application completion function. If set to non-zero, readline does not
attempt to append a closing quote to a completed word.
k. New application variable, rl_completion_found_quote, set to a non-zero
value if readline determines that the word to be completed is quoted.
Set before readline calls any application completion function.
-------------------------------------------------------------------------------
This is a terse description of the new features added to bash-2.05b since
the release of bash-2.05a. As always, the manual page (doc/bash.1) is
+1046
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,7 +1,7 @@
Introduction
============
This is GNU Bash, version 3.0b. Bash is the GNU Project's Bourne
This is GNU Bash, version 3.0. Bash is the GNU Project's Bourne
Again SHell, a complete implementation of the POSIX.2 shell spec,
but also with interactive command line editing, job control on
architectures that support it, csh-like features such as history
+90
View File
@@ -0,0 +1,90 @@
Introduction
============
This is GNU Bash, version 3.0b. Bash is the GNU Project's Bourne
Again SHell, a complete implementation of the POSIX.2 shell spec,
but also with interactive command line editing, job control on
architectures that support it, csh-like features such as history
substitution and brace expansion, and a slew of other features.
For more information on the features of Bash that are new to this
type of shell, see the file `doc/bashref.texi'. There is also a
large Unix-style man page. The man page is the definitive description
of the shell's features.
See the file CWRU/POSIX.NOTES for a discussion of how Bash differs
from the POSIX.2 spec and a description of the Bash `posix mode'.
There are some user-visible incompatibilities between this version
of Bash and the previous widely-distributed version, bash-1.14.
For details, see the file COMPAT. The NEWS file tersely lists
features that are new in this release.
Bash is free software, distributed under the terms of the [GNU]
General Public License, version 2. For more information, see the
file COPYING.
A number of frequently-asked questions are answered in the file
`doc/FAQ'.
To compile Bash, try typing `./configure', then `make'. Bash
auto-configures the build process, so no further intervention
should be necessary. Bash builds with `gcc' by default if it is
available. If you want to use `cc' instead, type
CC=cc ./configure
if you are using a Bourne-style shell. If you are not, the following
may work:
env CC=cc ./configure
Read the file INSTALL in this directory for more information about how
to customize and control the build process. The file NOTES contains
platform-specific installation and configuration information.
If you are a csh user and wish to convert your csh aliases to Bash
aliases, you may wish to use the script `examples/misc/alias-conv.sh'
as a starting point. The script `examples/misc/cshtobash' is a
more ambitious script that attempts to do a more complete job.
Reporting Bugs
==============
Bug reports for bash should be sent to:
bug-bash@gnu.org
using the `bashbug' program that is built and installed at the same
time as bash.
The discussion list `bug-bash@gnu.org' often contains information
about new ports of Bash, or discussions of new features or behavior
changes that people would like. This mailing list is also available
as a usenet newsgroup: gnu.bash.bug.
When you send a bug report, please use the `bashbug' program that is
built at the same time as bash. If bash fails to build, try building
bashbug directly with `make bashbug'. If you cannot build `bashbug',
please send mail to bug-bash@gnu.org with the following information:
* the version number and release status of Bash (e.g., 2.05a-release)
* the machine and OS that it is running on (you may run
`bashversion -l' from the bash build directory for this information)
* a list of the compilation flags or the contents of `config.h', if
appropriate
* a description of the bug
* a recipe for recreating the bug reliably
* a fix for the bug if you have one!
The `bashbug' program includes much of this automatically.
If you would like to contact the Bash maintainers directly, send mail
to bash-maintainers@gnu.org.
While the Bash maintainers do not promise to fix all bugs, we would
like this shell to be the best that we can make it.
Enjoy!
Chet Ramey
chet@po.cwru.edu
+1 -2
View File
@@ -1,5 +1,4 @@
Since Bash does not manipulate date strings, it is Y2K-safe.
The only thing that Bash does with date strings is manipulate the string
returned by ctime(3) in the prompt customization code. In all cases,
it discards the year.
returned by ctime(3) or strftime(3) in the prompt customization code.
+5
View File
@@ -0,0 +1,5 @@
Since Bash does not manipulate date strings, it is Y2K-safe.
The only thing that Bash does with date strings is manipulate the string
returned by ctime(3) in the prompt customization code. In all cases,
it discards the year.
File diff suppressed because it is too large Load Diff
+111
View File
@@ -0,0 +1,111 @@
# This file was created by autom4te.
# It contains the lists of macros which have been traced.
# It can be safely removed.
@request = (
bless( [
'0',
1,
[
'/sw/share/autoconf'
],
[
'/sw/share/autoconf/autoconf/autoconf.m4f',
'aclocal.m4',
'configure.in'
],
{
'AC_FUNC_FORK' => 1,
'AC_SUBST' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_HEADER_MAJOR' => 1,
'AC_C_INLINE' => 1,
'AC_FUNC_MALLOC' => 1,
'm4_pattern_allow' => 1,
'AC_FUNC_GETGROUPS' => 1,
'AC_TYPE_MODE_T' => 1,
'AC_FUNC_FSEEKO' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_STRUCT_ST_BLOCKS' => 1,
'AC_FUNC_GETLOADAVG' => 1,
'AC_C_VOLATILE' => 1,
'AC_FUNC_LSTAT' => 1,
'AC_FUNC_GETPGRP' => 1,
'AC_PROG_AWK' => 1,
'AC_FUNC_SETPGRP' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AC_FUNC_OBSTACK' => 1,
'AC_FUNC_MMAP' => 1,
'AM_MAINTAINER_MODE' => 1,
'AC_FUNC_MEMCMP' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AC_FUNC_STRCOLL' => 1,
'AC_CHECK_TYPES' => 1,
'AC_HEADER_DIRENT' => 1,
'AC_CHECK_MEMBERS' => 1,
'm4_include' => 1,
'AC_TYPE_SIGNAL' => 1,
'AC_TYPE_PID_T' => 1,
'AC_FUNC_SETVBUF_REVERSED' => 1,
'AC_CHECK_FUNCS' => 1,
'AC_CHECK_LIB' => 1,
'AC_HEADER_STAT' => 1,
'AC_PROG_LEX' => 1,
'AC_TYPE_SIZE_T' => 1,
'AC_HEADER_TIME' => 1,
'AC_FUNC_STRTOD' => 1,
'include' => 1,
'AC_STRUCT_TIMEZONE' => 1,
'AC_HEADER_STDC' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_GNU_GETTEXT' => 1,
'AC_FUNC_STRFTIME' => 1,
'AC_FUNC_ALLOCA' => 1,
'AC_C_CONST' => 1,
'AC_INIT' => 1,
'AM_CONDITIONAL' => 1,
'AC_LIBSOURCE' => 1,
'AC_PROG_GCC_TRADITIONAL' => 1,
'AC_TYPE_OFF_T' => 1,
'AC_CHECK_HEADERS' => 1,
'AC_FUNC_WAIT3' => 1,
'AC_FUNC_STRERROR_R' => 1,
'AC_FUNC_UTIME_NULL' => 1,
'AC_PATH_X' => 1,
'AC_PROG_CPP' => 1,
'AC_FUNC_ERROR_AT_LINE' => 1,
'AC_DECL_SYS_SIGLIST' => 1,
'AC_PROG_LN_S' => 1,
'AC_PROG_CXX' => 1,
'AC_FUNC_VPRINTF' => 1,
'AC_FUNC_CHOWN' => 1,
'm4_pattern_forbid' => 1,
'AC_TYPE_UID_T' => 1,
'AC_FUNC_MBRTOWC' => 1,
'AC_FUNC_SELECT_ARGTYPES' => 1,
'AC_STRUCT_TM' => 1,
'AC_PROG_CC' => 1,
'AC_PROG_INSTALL' => 1,
'AC_PROG_RANLIB' => 1,
'AH_OUTPUT' => 1,
'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
'AC_FUNC_STAT' => 1,
'AC_FUNC_REALLOC' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AC_PROG_MAKE_SET' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_FUNC_CLOSEDIR_VOID' => 1,
'AC_FUNC_STRNLEN' => 1,
'AC_HEADER_SYS_WAIT' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_REPLACE_FNMATCH' => 1,
'AC_CONFIG_FILES' => 1,
'AC_PROG_YACC' => 1,
'AC_FUNC_GETMNTENT' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AC_FUNC_MKTIME' => 1
}
], 'Request' )
);
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
/* bashline.c -- Bash's interface to the readline library. */
/* Copyright (C) 1987-2002 Free Software Foundation, Inc.
/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Vendored
+10790 -5732
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -25,7 +25,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_REVISION([for Bash 3.0, version 3.159, from autoconf version] AC_ACVERSION)dnl
define(bashvers, 3.0)
define(relstatus, alpha)
define(relstatus, beta1)
AC_INIT(bash, bashvers-relstatus, bug-bash@gnu.org)
+1028
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -11334,6 +11334,6 @@ Array variables may not (yet) be exported.
</DL>
<HR>
This document was created by man2html from bash.1.<BR>
Time: 13 November 2003 09:47:50 EST
Time: 08 January 2004 10:37:11 EST
</BODY>
</HTML>
+27
View File
@@ -439,4 +439,31 @@ extern char *xstrchr __P((const char *, int));
# define SADD_MBCHAR(_dst, _src, _si, _srcsize)
#endif
/* Watch out when using this -- it's just straight textual subsitution */
#if defined (HANDLE_MULTIBYTE)
# define SADD_MBQCHAR_BODY(_dst, _src, _si, _srcsize) \
\
int i; \
mbstate_t state_bak; \
size_t mblength; \
\
state_bak = state; \
mblength = mbrlen ((_src) + (_si), (_srcsize) - (_si), &state); \
if (mblength == (size_t)-1 || mblength == (size_t)-2) \
{ \
state = state_bak; \
mblength = 1; \
} \
if (mblength < 1) \
mblength = 1; \
\
(_dst) = (char *)xmalloc (mblength + 2); \
(_dst)[0] = CTLESC; \
for (i = 0; i < mblength; i++) \
(_dst)[i+1] = (_src)[(_si)++]; \
(_dst)[mblength+1] = '\0'; \
\
goto add_string
#endif /* HANDLE_MULTIBYTE */
#endif /* _SH_MBUTIL_H_ */
+469
View File
@@ -0,0 +1,469 @@
/* shmbutil.h -- utility functions for multibyte characters. */
/* Copyright (C) 2002 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 (_SH_MBUTIL_H_)
#define _SH_MBUTIL_H_
#include "stdc.h"
/************************************************/
/* check multibyte capability for I18N code */
/************************************************/
/* For platforms which support the ISO C amendement 1 functionality we
support user defined character classes. */
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
#if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H)
# include <wchar.h>
# include <wctype.h>
# if defined (HAVE_MBSRTOWCS) /* system is supposed to support XPG5 */
# define HANDLE_MULTIBYTE 1
# endif
#endif /* HAVE_WCTYPE_H && HAVE_WCHAR_H */
/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
#if HANDLE_MULTIBYTE && !defined (HAVE_MBSTATE_T)
# define wcsrtombs(dest, src, len, ps) (wcsrtombs) (dest, src, len, 0)
# define mbsrtowcs(dest, src, len, ps) (mbsrtowcs) (dest, src, len, 0)
# define wcrtomb(s, wc, ps) (wcrtomb) (s, wc, 0)
# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
# define mbrlen(s, n, ps) (mbrlen) (s, n, 0)
# define mbstate_t int
#endif /* HANDLE_MULTIBYTE && !HAVE_MBSTATE_T */
/* Make sure MB_LEN_MAX is at least 16 on systems that claim to be able to
handle multibyte chars (some systems define MB_LEN_MAX as 1) */
#ifdef HANDLE_MULTIBYTE
# include <limits.h>
# if defined(MB_LEN_MAX) && (MB_LEN_MAX < 16)
# undef MB_LEN_MAX
# endif
# if !defined (MB_LEN_MAX)
# define MB_LEN_MAX 16
# endif
#endif /* HANDLE_MULTIBYTE */
/************************************************/
/* end of multibyte capability checks for I18N */
/************************************************/
#if defined (HANDLE_MULTIBYTE)
extern size_t xmbsrtowcs __P((wchar_t *, const char **, size_t, mbstate_t *));
extern char *xstrchr __P((const char *, int));
#ifndef MB_INVALIDCH
#define MB_INVALIDCH(x) ((x) == (size_t)-1 || (x) == (size_t)-2)
#define MB_NULLWCH(x) ((x) == 0)
#endif
#else /* !HANDLE_MULTIBYTE */
#undef MB_LEN_MAX
#undef MB_CUR_MAX
#define MB_LEN_MAX 1
#define MB_CUR_MAX 1
#undef xstrchr
#define xstrchr(s, c) strchr(s, c)
#ifndef MB_INVALIDCH
#define MB_INVALIDCH(x) (0)
#define MB_NULLWCH(x) (0)
#endif
#endif /* !HANDLE_MULTIBYTE */
/* Declare and initialize a multibyte state. Call must be terminated
with `;'. */
#if defined (HANDLE_MULTIBYTE)
# define DECLARE_MBSTATE \
mbstate_t state; \
memset (&state, '\0', sizeof (mbstate_t))
#else
# define DECLARE_MBSTATE
#endif /* !HANDLE_MULTIBYTE */
/* Initialize or reinitialize a multibyte state named `state'. Call must be
terminated with `;'. */
#if defined (HANDLE_MULTIBYTE)
# define INITIALIZE_MBSTATE memset (&state, '\0', sizeof (mbstate_t))
#else
# define INITIALIZE_MBSTATE
#endif /* !HANDLE_MULTIBYTE */
/* Advance one (possibly multi-byte) character in string _STR of length
_STRSIZE, starting at index _I. STATE must have already been declared. */
#if defined (HANDLE_MULTIBYTE)
# define ADVANCE_CHAR(_str, _strsize, _i) \
do \
{ \
if (MB_CUR_MAX > 1) \
{ \
mbstate_t state_bak; \
size_t mblength; \
\
state_bak = state; \
mblength = mbrlen ((_str) + (_i), (_strsize) - (_i), &state); \
\
if (mblength == (size_t)-2 || mblength == (size_t)-1) \
{ \
state = state_bak; \
(_i)++; \
} \
else if (mblength == 0) \
(_i)++; \
else \
(_i) += mblength; \
} \
else \
(_i)++; \
} \
while (0)
#else
# define ADVANCE_CHAR(_str, _strsize, _i) (_i)++
#endif /* !HANDLE_MULTIBYTE */
/* Advance one (possibly multibyte) character in the string _STR of length
_STRSIZE.
SPECIAL: assume that _STR will be incremented by 1 after this call. */
#if defined (HANDLE_MULTIBYTE)
# define ADVANCE_CHAR_P(_str, _strsize) \
do \
{ \
if (MB_CUR_MAX > 1) \
{ \
mbstate_t state_bak; \
size_t mblength; \
\
state_bak = state; \
mblength = mbrlen ((_str), (_strsize), &state); \
\
if (mblength == (size_t)-2 || mblength == (size_t)-1) \
{ \
state = state_bak; \
mblength = 1; \
} \
else \
(_str) += (mblength < 1) ? 0 : (mblength - 1); \
} \
} \
while (0)
#else
# define ADVANCE_CHAR_P(_str, _strsize)
#endif /* !HANDLE_MULTIBYTE */
/* Back up one (possibly multi-byte) character in string _STR of length
_STRSIZE, starting at index _I. STATE must have already been declared. */
#if defined (HANDLE_MULTIBYTE)
# define BACKUP_CHAR(_str, _strsize, _i) \
do \
{ \
if (MB_CUR_MAX > 1) \
{ \
mbstate_t state_bak; \
size_t mblength; \
int _x, _p; /* _x == temp index into string, _p == prev index */ \
\
_x = _p = 0; \
while (_x < (_i)) \
{ \
state_bak = state; \
mblength = mbrlen ((_str) + (_x), (_strsize) - (_x), &state); \
\
if (mblength == (size_t)-2 || mblength == (size_t)-1) \
{ \
state = state_bak; \
_x++; \
} \
else if (mblength == 0) \
_x++; \
else \
{ \
_p = _x; /* _p == start of prev mbchar */ \
_x += mblength; \
} \
} \
(_i) = _p; \
} \
else \
(_i)--; \
} \
while (0)
#else
# define BACKUP_CHAR(_str, _strsize, _i) (_i)--
#endif /* !HANDLE_MULTIBYTE */
/* Back up one (possibly multibyte) character in the string _BASE of length
_STRSIZE starting at _STR (_BASE <= _STR <= (_BASE + _STRSIZE) ).
SPECIAL: DO NOT assume that _STR will be decremented by 1 after this call. */
#if defined (HANDLE_MULTIBYTE)
# define BACKUP_CHAR_P(_base, _strsize, _str) \
do \
{ \
if (MB_CUR_MAX > 1) \
{ \
mbstate_t state_bak; \
size_t mblength; \
char *_x, _p; /* _x == temp pointer into string, _p == prev pointer */ \
\
_x = _p = _base; \
while (_x < (_str)) \
{ \
state_bak = state; \
mblength = mbrlen (_x, (_strsize) - _x, &state); \
\
if (mblength == (size_t)-2 || mblength == (size_t)-1) \
{ \
state = state_bak; \
_x++; \
} \
else if (mblength == 0) \
_x++; \
else \
{ \
_p = _x; /* _p == start of prev mbchar */ \
_x += mblength; \
} \
} \
(_str) = _p; \
} \
else \
(_str)--; \
} \
while (0)
#else
# define BACKUP_CHAR_P(_base, _strsize, _str) (_str)--
#endif /* !HANDLE_MULTIBYTE */
/* Copy a single character from the string _SRC to the string _DST.
_SRCEND is a pointer to the end of _SRC. */
#if defined (HANDLE_MULTIBYTE)
# define COPY_CHAR_P(_dst, _src, _srcend) \
do \
{ \
if (MB_CUR_MAX > 1) \
{ \
mbstate_t state_bak; \
size_t mblength; \
int _k; \
\
state_bak = state; \
mblength = mbrlen ((_src), (_srcend) - (_src), &state); \
if (mblength == (size_t)-2 || mblength == (size_t)-1) \
{ \
state = state_bak; \
mblength = 1; \
} \
else \
mblength = (mblength < 1) ? 1 : mblength; \
\
for (_k = 0; _k < mblength; _k++) \
*(_dst)++ = *(_src)++; \
} \
else \
*(_dst)++ = *(_src)++; \
} \
while (0)
#else
# define COPY_CHAR_P(_dst, _src, _srcend) *(_dst)++ = *(_src)++
#endif /* !HANDLE_MULTIBYTE */
/* Copy a single character from the string _SRC at index _SI to the string
_DST at index _DI. _SRCEND is a pointer to the end of _SRC. */
#if defined (HANDLE_MULTIBYTE)
# define COPY_CHAR_I(_dst, _di, _src, _srcend, _si) \
do \
{ \
if (MB_CUR_MAX > 1) \
{ \
mbstate_t state_bak; \
size_t mblength; \
int _k; \
\
state_bak = state; \
mblength = mbrlen ((_src) + (_si), (_srcend) - ((_src)+(_si)), &state); \
if (mblength == (size_t)-2 || mblength == (size_t)-1) \
{ \
state = state_bak; \
mblength = 1; \
} \
else \
mblength = (mblength < 1) ? 1 : mblength; \
\
for (_k = 0; _k < mblength; _k++) \
_dst[_di++] = _src[_si++]; \
} \
else \
_dst[_di++] = _src[_si++]; \
} \
while (0)
#else
# define COPY_CHAR_I(_dst, _di, _src, _srcend, _si) _dst[_di++] = _src[_si++]
#endif /* !HANDLE_MULTIBYTE */
/****************************************************************
* *
* The following are only guaranteed to work in subst.c *
* *
****************************************************************/
#if defined (HANDLE_MULTIBYTE)
# define SCOPY_CHAR_I(_dst, _escchar, _sc, _src, _si, _slen) \
do \
{ \
if (MB_CUR_MAX > 1) \
{ \
mbstate_t state_bak; \
size_t mblength; \
int _i; \
\
state_bak = state; \
mblength = mbrlen ((_src) + (_si), (_slen) - (_si), &state); \
if (mblength == (size_t)-2 || mblength == (size_t)-1) \
{ \
state = state_bak; \
mblength = 1; \
} \
else \
mblength = (mblength < 1) ? 1 : mblength; \
\
temp = xmalloc (mblength + 2); \
temp[0] = _escchar; \
for (_i = 0; _i < mblength; _i++) \
temp[_i + 1] = _src[_si++]; \
temp[mblength + 1] = '\0'; \
\
goto add_string; \
} \
else \
{ \
_dst[0] = _escchar; \
_dst[1] = _sc; \
} \
} \
while (0)
#else
# define SCOPY_CHAR_I(_dst, _escchar, _sc, _src, _si, _slen) \
_dst[0] = _escchar; \
_dst[1] = _sc
#endif /* !HANDLE_MULTIBYTE */
#if defined (HANDLE_MULTIBYTE)
# define SCOPY_CHAR_M(_dst, _src, _srcend, _si) \
do \
{ \
if (MB_CUR_MAX > 1) \
{ \
mbstate_t state_bak; \
size_t mblength; \
\
state_bak = state; \
mblength = mbrlen ((_src) + (_si), (_srcend) - ((_src) + (_si)), &state); \
if (mblength == (size_t)-2 || mblength == (size_t)-1) \
{ \
state = state_bak; \
mblength = 1; \
} \
else \
mblength = (mblength < 1) ? 1 : mblength; \
\
FASTCOPY(((_src) + (_si)), (_dst), mblength); \
\
(_dst) += mblength; \
(_si) += mblength; \
} \
else \
{ \
*(_dst)++ = _src[(_si)]; \
(_si)++; \
} \
} \
while (0)
#else
# define SCOPY_CHAR_M(_dst, _src, _srcend, _si) \
*(_dst)++ = _src[(_si)]; \
(_si)++
#endif /* !HANDLE_MULTIBYTE */
#if HANDLE_MULTIBYTE
# define SADD_MBCHAR(_dst, _src, _si, _srcsize) \
do \
{ \
if (MB_CUR_MAX > 1) \
{ \
int i; \
mbstate_t state_bak; \
size_t mblength; \
\
state_bak = state; \
mblength = mbrlen ((_src) + (_si), (_srcsize) - (_si), &state); \
if (mblength == (size_t)-1 || mblength == (size_t)-2) \
{ \
state = state_bak; \
mblength = 1; \
} \
if (mblength < 1) \
mblength = 1; \
\
_dst = (char *)xmalloc (mblength + 1); \
for (i = 0; i < mblength; i++) \
(_dst)[i] = (_src)[(_si)++]; \
(_dst)[mblength] = '\0'; \
\
goto add_string; \
} \
} \
while (0)
#else
# define SADD_MBCHAR(_dst, _src, _si, _srcsize)
#endif
/* Watch out when using this -- it's just straight textual subsitution */
#if defined (HANDLE_MULTIBYTE)
# define SADD_MBQCHAR_BODY(_dst, _src, _si, _srcsize) \
\ int i; \
mbstate_t state_bak; \
size_t mblength; \
\
state_bak = state; \
mblength = mbrlen ((_src) + (_si), (_srcsize) - (_si), &state); \
if (mblength == (size_t)-1 || mblength == (size_t)-2) \
{ \
state = state_bak; \
mblength = 1; \
} \
if (mblength < 1) \
mblength = 1; \
\
(_dst) = (char *)xmalloc (mblength + 2); \
(_dst)[0] = CTLESC; \
for (i = 0; i < mblength; i++) \
(_dst)[i+1] = (_src)[(_si)++]; \
(_dst)[mblength+1] = '\0'; \
\
goto add_string
#endif /* HANDLE_MULTIBYTE */
#endif /* _SH_MBUTIL_H_ */
+23
View File
@@ -1010,6 +1010,7 @@ compute_lcd_of_matches (match_list, matches, text)
{
register int i, c1, c2, si;
int low; /* Count of max-matched characters. */
char *dtext; /* dequoted TEXT, if needed */
#if defined (HANDLE_MULTIBYTE)
int v;
mbstate_t ps1, ps2;
@@ -1101,6 +1102,26 @@ compute_lcd_of_matches (match_list, matches, text)
the user typed in the face of multiple matches differing in case. */
if (_rl_completion_case_fold)
{
/* We're making an assumption here:
IF we're completing filenames AND
the application has defined a filename dequoting function AND
we found a quote character AND
the application has requested filename quoting
THEN
we assume that TEXT was dequoted before checking against
the file system and needs to be dequoted here before we
check against the list of matches
FI */
dtext = (char *)NULL;
if (rl_filename_completion_desired &&
rl_filename_dequoting_function &&
rl_completion_found_quote &&
rl_filename_quoting_desired)
{
dtext = (*rl_filename_dequoting_function) (text, rl_completion_quote_character);
text = dtext;
}
/* sort the list to get consistent answers. */
qsort (match_list+1, matches, sizeof(char *), (QSFUNC *)_rl_qsort_string_compare);
@@ -1120,6 +1141,8 @@ compute_lcd_of_matches (match_list, matches, text)
else
/* otherwise, just use the text the user typed. */
strncpy (match_list[0], text, low);
FREE (dtext);
}
else
strncpy (match_list[0], match_list[1], low);
+7 -9
View File
@@ -316,7 +316,7 @@ rl_expand_prompt (prompt)
t = ++p;
local_prompt = expand_prompt (p, &prompt_visible_length,
&prompt_last_invisible,
&prompt_invis_chars_first_line);
(int *)NULL);
c = *t; *t = '\0';
/* The portion of the prompt string up to and including the
final newline is now null-terminated. */
@@ -546,15 +546,13 @@ rl_redisplay ()
prompt_invis_chars_first_line variable could be made into an array
saying how many invisible characters there are per line, but that's
probably too much work for the benefit gained. How many people have
prompts that exceed two physical lines? */
prompts that exceed two physical lines?
Additional logic fix from Edward Catmur <ed@catmur.co.uk> */
temp = ((newlines + 1) * _rl_screenwidth) +
#if 0
((newlines == 0) ? prompt_invis_chars_first_line : 0) +
#else
((newlines == 0 && local_prompt_prefix == 0) ? prompt_invis_chars_first_line : 0) +
#endif
((newlines == 1) ? wrap_offset : 0);
((local_prompt_prefix == 0) ? ((newlines == 0) ? prompt_invis_chars_first_line
: ((newlines == 1) ? wrap_offset : 0))
: ((newlines == 0) ? wrap_offset :0));
inv_lbreaks[++newlines] = temp;
lpos -= _rl_screenwidth;
}
+7
View File
@@ -1728,6 +1728,13 @@ It is set to 0 before any application-specific completion function
is called, and may only be changed within such a function.
@end deftypevar
@deftypevar int rl_completion_found_quote
When Readline is completing quoted text, it sets this variable
to a non-zero value if the word being completed contains or is delimited
by any quoting characters, including backslashes.
This is set before any application-specific completion function is called.
@end deftypevar
@deftypevar int rl_completion_mark_symlink_dirs
If non-zero, a slash will be appended to completed filenames that are
symbolic links to directory names, subject to the value of the
+4 -4
View File
@@ -1,10 +1,10 @@
@ignore
Copyright (C) 1988-2003 Free Software Foundation, Inc.
Copyright (C) 1988-2004 Free Software Foundation, Inc.
@end ignore
@set EDITION 5.0
@set VERSION 5.0
@set UPDATED 11 October 2003
@set UPDATED-MONTH October 2003
@set UPDATED 8 January 2004
@set UPDATED-MONTH January 2003
@set LASTCHANGE Sat Oct 11 23:48:11 EDT 2003
@set LASTCHANGE Thu Jan 8 10:34:23 EST 2004
+1 -1
View File
@@ -1,7 +1,7 @@
/* pcomplete.c - functions to generate lists of matches for programmable
completion. */
/* Copyright (C) 1999-2002 Free Software Foundation, Inc.
/* Copyright (C) 1999-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
+284
View File
@@ -0,0 +1,284 @@
/* stringlib.c - Miscellaneous string functions. */
/* Copyright (C) 1996-2002 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. */
#include "config.h"
#include "bashtypes.h"
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif
#include "bashansi.h"
#include <stdio.h>
#include "chartypes.h"
#include "shell.h"
#include "pathexp.h"
#include <glob/glob.h>
#if defined (EXTENDED_GLOB)
# include <glob/strmatch.h>
#endif
/* **************************************************************** */
/* */
/* Functions to manage arrays of strings */
/* */
/* **************************************************************** */
/* Find STRING in ALIST, a list of string key/int value pairs. If FLAGS
is 1, STRING is treated as a pattern and matched using strmatch. */
int
find_string_in_alist (string, alist, flags)
char *string;
STRING_INT_ALIST *alist;
int flags;
{
register int i;
int r;
for (i = r = 0; alist[i].word; i++)
{
#if defined (EXTENDED_GLOB)
if (flags)
r = strmatch (alist[i].word, string, FNM_EXTMATCH) != FNM_NOMATCH;
else
#endif
r = STREQ (string, alist[i].word);
if (r)
return (alist[i].token);
}
return -1;
}
/* Find TOKEN in ALIST, a list of string/int value pairs. Return the
corresponding string. Allocates memory for the returned
string. FLAGS is currently ignored, but reserved. */
char *
find_token_in_alist (token, alist, flags)
int token;
STRING_INT_ALIST *alist;
int flags;
{
register int i;
for (i = 0; alist[i].word; i++)
{
if (alist[i].token == token)
return (savestring (alist[i].word));
}
return ((char *)NULL);
}
int
find_index_in_alist (string, alist, flags)
char *string;
STRING_INT_ALIST *alist;
int flags;
{
register int i;
int r;
for (i = r = 0; alist[i].word; i++)
{
#if defined (EXTENDED_GLOB)
if (flags)
r = strmatch (alist[i].word, string, FNM_EXTMATCH) != FNM_NOMATCH;
else
#endif
r = STREQ (string, alist[i].word);
if (r)
return (i);
}
return -1;
}
/* **************************************************************** */
/* */
/* String Management Functions */
/* */
/* **************************************************************** */
/* Cons a new string from STRING starting at START and ending at END,
not including END. */
char *
substring (string, start, end)
char *string;
int start, end;
{
register int len;
register char *result;
len = end - start;
result = (char *)xmalloc (len + 1);
strncpy (result, string + start, len);
result[len] = '\0';
return (result);
}
/* Replace occurrences of PAT with REP in STRING. If GLOBAL is non-zero,
replace all occurrences, otherwise replace only the first.
This returns a new string; the caller should free it. */
char *
strsub (string, pat, rep, global)
char *string, *pat, *rep;
int global;
{
int patlen, replen, templen, tempsize, repl, i;
char *temp, *r;
patlen = strlen (pat);
replen = strlen (rep);
for (temp = (char *)NULL, i = templen = tempsize = 0, repl = 1; string[i]; )
{
if (repl && STREQN (string + i, pat, patlen))
{
if (replen)
RESIZE_MALLOCED_BUFFER (temp, templen, replen, tempsize, (replen * 2));
for (r = rep; *r; )
temp[templen++] = *r++;
i += patlen ? patlen : 1; /* avoid infinite recursion */
repl = global != 0;
}
else
{
RESIZE_MALLOCED_BUFFER (temp, templen, 1, tempsize, 16);
temp[templen++] = string[i++];
}
}
temp[templen] = 0;
return (temp);
}
/* Replace all instances of C in STRING with TEXT. TEXT may be empty or
NULL. If DO_GLOB is non-zero, we quote the replacement text for
globbing. Backslash may be used to quote C. */
char *
strcreplace (string, c, text, do_glob)
char *string;
int c;
char *text;
int do_glob;
{
char *ret, *p, *r, *t;
int len, rlen, ind, tlen;
len = STRLEN (text);
rlen = len + strlen (string) + 2;
ret = (char *)xmalloc (rlen);
for (p = string, r = ret; p && *p; )
{
if (*p == c)
{
if (len)
{
ind = r - ret;
if (do_glob && (glob_pattern_p (text) || strchr (text, '\\')))
{
t = quote_globbing_chars (text);
tlen = strlen (t);
RESIZE_MALLOCED_BUFFER (ret, ind, tlen, rlen, rlen);
r = ret + ind; /* in case reallocated */
strcpy (r, t);
r += tlen;
free (t);
}
else
{
RESIZE_MALLOCED_BUFFER (ret, ind, len, rlen, rlen);
r = ret + ind; /* in case reallocated */
strcpy (r, text);
r += len;
}
}
p++;
continue;
}
if (*p == '\\' && p[1] == c)
p++;
ind = r - ret;
RESIZE_MALLOCED_BUFFER (ret, ind, 2, rlen, rlen);
r = ret + ind; /* in case reallocated */
*r++ = *p++;
}
*r = '\0';
return ret;
}
#ifdef INCLUDE_UNUSED
/* Remove all leading whitespace from STRING. This includes
newlines. STRING should be terminated with a zero. */
void
strip_leading (string)
char *string;
{
char *start = string;
while (*string && (whitespace (*string) || *string == '\n'))
string++;
if (string != start)
{
int len = strlen (string);
FASTCOPY (string, start, len);
start[len] = '\0';
}
}
#endif
/* Remove all trailing whitespace from STRING. This includes
newlines. If NEWLINES_ONLY is non-zero, only trailing newlines
are removed. STRING should be terminated with a zero. */
void
strip_trailing (string, len, newlines_only)
char *string;
int len;
int newlines_only;
{
while (len >= 0)
{
if ((newlines_only && string[len] == '\n') ||
(!newlines_only && whitespace (string[len])))
len--;
else
break;
}
string[len + 1] = '\0';
}
/* A wrapper for bcopy that can be prototyped in general.h */
void
xbcopy (s, d, n)
char *s, *d;
int n;
{
FASTCOPY (s, d, n);
}
+198 -67
View File
@@ -4,7 +4,7 @@
/* ``Have a little faith, there's magic in the night. You ain't a
beauty, but, hey, you're alright.'' */
/* Copyright (C) 1987-2003 Free Software Foundation, Inc.
/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -210,6 +210,8 @@ static char *extract_dollar_brace_string __P((char *, int *, int, int));
static char *pos_params __P((char *, int, int, int));
static unsigned char *mb_getcharlens __P((char *, int));
static char *remove_pattern __P((char *, char *, int));
static int match_pattern_char __P((char *, char *));
static int match_pattern __P((char *, char *, int, char **, char **));
@@ -245,6 +247,7 @@ static intmax_t parameter_brace_expand_length __P((char *));
static char *skiparith __P((char *, int));
static int verify_substring_values __P((char *, char *, int, intmax_t *, intmax_t *));
static int get_var_and_type __P((char *, char *, SHELL_VAR **, char **));
static char *mb_substring __P((char *, int, int));
static char *parameter_brace_substring __P((char *, char *, char *, int));
static char *pos_params_pat_subst __P((char *, char *, char *, int));
@@ -2836,6 +2839,31 @@ word_list_remove_quoted_nulls (list)
/* */
/* **************************************************************** */
#if defined (HANDLE_MULTIBYTE)
static unsigned char *
mb_getcharlens (string, len)
char *string;
int len;
{
int i, offset;
unsigned char last, *ret;
char *p;
DECLARE_MBSTATE;
i = offset = 0;
last = 0;
ret = (unsigned char *)xmalloc (len);
memset (ret, 0, len);
while (string[last])
{
ADVANCE_CHAR (string, len, offset);
ret[last] = offset - last;
last = offset;
}
return ret;
}
#endif
/* Remove the portion of PARAM matched by PATTERN according to OP, where OP
can have one of 4 values:
RP_LONG_LEFT remove longest matching portion at start of PARAM
@@ -2857,6 +2885,9 @@ remove_pattern (param, pattern, op)
register int len;
register char *end;
register char *p, *ret, c;
int offset;
unsigned char *mblen;
DECLARE_MBSTATE;
if (param == NULL)
return (param);
@@ -2866,25 +2897,42 @@ remove_pattern (param, pattern, op)
len = STRLEN (param);
end = param + len;
mblen = (unsigned char *)0;
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && (op == RP_LONG_LEFT || op == RP_SHORT_RIGHT))
mblen = mb_getcharlens (param, len);
#endif
switch (op)
{
case RP_LONG_LEFT: /* remove longest match at start */
/* BACKUP_CHAR_P (param, len, p); */
for (p = end; p >= param; p--)
p = end;
while (p >= param)
{
c = *p; *p = '\0';
if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH)
{
*p = c;
FREE (mblen);
return (savestring (p));
}
*p = c;
if (MB_CUR_MAX > 1)
{
while (p >= param)
if (mblen[--p - param])
break;
}
else
p--;
}
break;
case RP_SHORT_LEFT: /* remove shortest match at start */
/* ADVANCE_CHAR_P (p, end - p),p++ */
for (p = param; p <= end; p++)
p = param;
offset = 0;
while (p <= end)
{
c = *p; *p = '\0';
if (strmatch (pattern, param, FNMATCH_EXTFLAG) != FNM_NOMATCH)
@@ -2893,12 +2941,21 @@ remove_pattern (param, pattern, op)
return (savestring (p));
}
*p = c;
if (MB_CUR_MAX > 1)
{
ADVANCE_CHAR (param, len, offset);
p = param + offset;
}
else
p++;
}
break;
case RP_LONG_RIGHT: /* remove longest match at end */
/* ADVANCE_CHAR_P (p, end - p),p++ */
for (p = param; p <= end; p++)
p = param;
offset = 0;
while (p <= end)
{
if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH)
{
@@ -2907,23 +2964,43 @@ remove_pattern (param, pattern, op)
*p = c;
return (ret);
}
if (MB_CUR_MAX > 1)
{
ADVANCE_CHAR (param, len, offset);
p = param + offset;
}
else
p++;
}
break;
case RP_SHORT_RIGHT: /* remove shortest match at end */
/* BACKUP_CHAR_P (param, len, p); */
for (p = end; p >= param; p--)
p = end;
while (p >= param)
{
if (strmatch (pattern, p, FNMATCH_EXTFLAG) != FNM_NOMATCH)
{
c = *p; *p = '\0';
ret = savestring (param);
*p = c;
FREE (mblen);
return (ret);
}
if (MB_CUR_MAX > 1)
{
while (p >= param)
if (mblen[--p - param])
break;
}
else
p--;
}
break;
}
FREE (mblen);
return (savestring (param)); /* no match, return original string */
}
@@ -2972,6 +3049,9 @@ match_pattern (string, pat, mtype, sp, ep)
int c, len;
register char *p, *p1;
char *end;
int offset;
unsigned char *mblen;
DECLARE_MBSTATE;
if (string == 0 || *string == 0 || pat == 0 || *pat == 0)
return (0);
@@ -2979,16 +3059,23 @@ match_pattern (string, pat, mtype, sp, ep)
len = STRLEN (string);
end = string + len;
mblen = (unsigned char *)0;
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && (mtype == MATCH_ANY || mtype == MATCH_BEG))
mblen = mb_getcharlens (string, len);
#endif
switch (mtype)
{
case MATCH_ANY:
/* ADVANCE_CHAR_P (p, end - p),p++ */
for (p = string; p <= end; p++)
p = string;
offset = 0;
while (p <= end)
{
if (match_pattern_char (pat, p))
{
/* BACKUP_CHAR_P (p, end - p, p1) */
for (p1 = end; p1 >= p; p1--)
p1 = end;
while (p1 >= p)
{
c = *p1; *p1 = '\0';
if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0)
@@ -2996,19 +3083,40 @@ match_pattern (string, pat, mtype, sp, ep)
*p1 = c;
*sp = p;
*ep = p1;
FREE (mblen);
return 1;
}
*p1 = c;
if (MB_CUR_MAX > 1)
{
while (p1 >= p)
if (mblen[--p1 - string])
break;
}
else
p1--;
}
}
if (MB_CUR_MAX > 1)
{
ADVANCE_CHAR (string, len, offset);
p = string + offset;
}
else
p++;
}
FREE (mblen);
return (0);
case MATCH_BEG:
if (match_pattern_char (pat, string) == 0)
return (0);
/* BACKUP_CHAR_P (string, len, p) */
for (p = end; p >= string; p--)
p = end;
while (p >= string)
{
c = *p; *p = '\0';
if (strmatch (pat, string, FNMATCH_EXTFLAG) == 0)
@@ -3016,24 +3124,48 @@ match_pattern (string, pat, mtype, sp, ep)
*p = c;
*sp = string;
*ep = p;
FREE (mblen);
return 1;
}
*p = c;
if (MB_CUR_MAX > 1)
{
while (p >= string)
if (mblen[--p - string])
break;
}
else
p--;
}
FREE (mblen);
return (0);
case MATCH_END:
/* ADVANCE_CHAR_P(p, end - p), p++ */
for (p = string; p <= end; p++)
if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0)
{
*sp = p;
*ep = end;
return 1;
}
p = string;
offset = 0;
while (p <= end)
{
if (strmatch (pat, p, FNMATCH_EXTFLAG) == 0)
{
*sp = p;
*ep = end;
return 1;
}
if (MB_CUR_MAX > 1)
{
ADVANCE_CHAR (string, len, offset);
p = string + offset;
}
else
p++;
}
return (0);
}
FREE (mblen);
return (0);
}
@@ -4622,6 +4754,35 @@ get_var_and_type (varname, value, varp, valp)
/* */
/******************************************************/
#if defined (HANDLE_MULTIBYTE)
/* Character-oriented rather than strictly byte-oriented substrings. S and
E, rather being strict indices into STRING, indicate character (possibly
multibyte character) positions that require calculation.
Used by the ${param:offset[:length]} expansion. */
static char *
mb_substring (string, s, e)
char *string;
int s, e;
{
char *tt;
int start, stop, i, slen;
DECLARE_MBSTATE;
start = 0;
slen = STRLEN (string);
i = s;
while (string[start] && i--)
ADVANCE_CHAR (string, slen, start);
stop = start;
i = e - s;
while (string[stop] && i--)
ADVANCE_CHAR (string, slen, stop);
tt = substring (string, start, stop);
return tt;
}
#endif
/* Process a variable substring expansion: ${name:e1[:e2]}. If VARNAME
is `@', use the positional parameters; otherwise, use the value of
VARNAME. If VARNAME is an array variable, use the array elements. */
@@ -4656,7 +4817,13 @@ parameter_brace_substring (varname, value, substr, quoted)
{
case VT_VARIABLE:
case VT_ARRAYMEMBER:
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1)
tt = mb_substring (val, e1, e2);
else
#endif
tt = substring (val, e1, e2);
if (vtype == VT_VARIABLE)
FREE (val);
if (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))
@@ -5747,26 +5914,7 @@ expand_word_internal (word, quoted, isexp, contains_dollar_at, expanded_somethin
#if HANDLE_MULTIBYTE
if (MB_CUR_MAX > 1 && string[sindex])
{
int i;
mbstate_t state_bak;
size_t mblength;
state_bak = state;
mblength = mbrlen (string + sindex, string_size - sindex, &state);
if (MB_INVALIDCH (mblength))
{
state = state_bak;
mblength = 1;
}
if (mblength < 1)
mblength = 1;
temp = (char *)xmalloc (mblength + 2);
temp[0] = CTLESC;
for (i = 0; i < mblength; i++)
temp[i+1] = string[sindex++];
temp[mblength + 1] = '\0';
goto add_string;
SADD_MBQCHAR_BODY(temp, string, sindex, string_size);
}
else
#endif
@@ -6014,7 +6162,9 @@ add_twochars:
/* HOWEVER, this fails if the string contains a literal
CTLNUL or CTLNUL is contained in the (non-null) expansion
of some variable. I'm not sure what to do about this
yet. */
yet. There has to be some way to indicate the difference
between the two. An auxiliary data structure might be
necessary. */
if (QUOTED_NULL (temp) == 0)
remove_quoted_nulls (temp); /* XXX */
#endif
@@ -6104,31 +6254,12 @@ add_twochars:
else
{
#if HANDLE_MULTIBYTE
/* XXX - I'd like to use SCOPY_CHAR_I here. */
if (MB_CUR_MAX > 1)
sindex--;
if (MB_CUR_MAX > 1)
{
int i;
mbstate_t state_bak;
size_t mblength;
sindex--;
state_bak = state;
mblength = mbrlen (string + sindex, string_size - sindex, &state);
if (MB_INVALIDCH (mblength))
{
state = state_bak;
mblength = 1;
}
if (mblength < 1)
mblength = 1;
temp = (char *)xmalloc (mblength + 2);
temp[0] = CTLESC;
for (i = 0; i < mblength; i++)
temp[i + 1] = string[sindex++];
temp[mblength + 1] = '\0';
goto add_string;
SADD_MBQCHAR_BODY(temp, string, sindex, string_size);
}
else
#endif
+6969
View File
File diff suppressed because it is too large Load Diff
+7005
View File
File diff suppressed because it is too large Load Diff
+7093
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,4 +1,4 @@
BUILD_DIR=/usr/local/build/chet/bash/bash-current
BUILD_DIR=/usr/local/build/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
+9
View File
@@ -0,0 +1,9 @@
BUILD_DIR=/usr/local/build/chet/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
export THIS_SH PATH
rm -f /tmp/xx
/bin/sh "$@"