commit bash-20131018 snapshot

This commit is contained in:
Chet Ramey
2013-11-05 11:32:59 -05:00
parent a78d0a1f49
commit 39feef01a7
62 changed files with 39090 additions and 140 deletions
+25
View File
@@ -5284,3 +5284,28 @@ lib/readline/readline.c
- bind_arrow_keys_internal: added more key bindings for the numeric key
pad arrow keys on mingw32. Patch from Pierre Muller
<pierre.muller@ics-cnrs.unistra.fr>
10/19
-----
bashline.c
- maybe_restore_tilde: version of restore_tilde that honors `direxpand';
calls restore_tilde after saving directory expansion hook if
necessary. Report from Andreas Schwab <schwab@linux-m68k.org>
builtins/cd.def
- -@: new option, allows cd to use `extended attributes' present in
NFSv4, ZFS; idea taken from ksh93. Attributes associated with a
file are presented as a directory containing the attributes as
individual files. Original patch contributed by Cedric Blancher
<cedric.blancher@gmail.com>
10/20
-----
aclocal.m4
- BASH_CHECK_MULTIBYTE: check for wcwidth being broken with unicode
combining characters needs a value to use when cross-compiling.
Bug report from Bert Sutherland <bertsutherland@gmail.com>
doc/{bash.1,bashref.texi}
- document new -@ option to cd builtin
+5308
View File
File diff suppressed because it is too large Load Diff
Vendored
+1 -1
View File
@@ -1784,7 +1784,7 @@ char **v;
exit (w == 0); /* exit 0 if wcwidth broken */
}
],
bash_cv_wcwidth_broken=yes, bash_cv_wcwdith_broken=no)])
bash_cv_wcwidth_broken=yes, bash_cv_wcwdith_broken=no, bash_cv_wcwidth_broken=no)])
if test "$bash_cv_wcwidth_broken" = yes; then
AC_DEFINE(WCWIDTH_BROKEN, 1, [wcwidth is usually not broken])
fi
Vendored
+4195
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -1,7 +1,7 @@
@%:@! /bin/sh
@%:@ From configure.ac for Bash 4.3, version 4.059.
@%:@ From configure.ac for Bash 4.3, version 4.060.
@%:@ Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by GNU Autoconf 2.69 for bash 4.3-beta2.
@%:@ Generated by GNU Autoconf 2.69 for bash 4.3-rc1.
@%:@
@%:@ Report bugs to <bug-bash@gnu.org>.
@%:@
@@ -581,8 +581,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='bash'
PACKAGE_TARNAME='bash'
PACKAGE_VERSION='4.3-beta2'
PACKAGE_STRING='bash 4.3-beta2'
PACKAGE_VERSION='4.3-rc1'
PACKAGE_STRING='bash 4.3-rc1'
PACKAGE_BUGREPORT='bug-bash@gnu.org'
PACKAGE_URL=''
@@ -1393,7 +1393,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures bash 4.3-beta2 to adapt to many kinds of systems.
\`configure' configures bash 4.3-rc1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1458,7 +1458,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bash 4.3-beta2:";;
short | recursive ) echo "Configuration of bash 4.3-rc1:";;
esac
cat <<\_ACEOF
@@ -1650,7 +1650,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bash configure 4.3-beta2
bash configure 4.3-rc1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2359,7 +2359,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bash $as_me 4.3-beta2, which was
It was created by bash $as_me 4.3-rc1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2753,7 +2753,7 @@ ac_config_headers="$ac_config_headers config.h"
BASHVERS=4.3
RELSTATUS=beta2
RELSTATUS=rc1
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
@@ -16539,7 +16539,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by bash $as_me 4.3-beta2, which was
This file was extended by bash $as_me 4.3-rc1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16605,7 +16605,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
bash config.status 4.3-beta2
bash config.status 4.3-rc1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
+19 -19
View File
@@ -15,57 +15,57 @@
'configure.ac'
],
{
'_LT_AC_TAGCONFIG' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_INIT' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
'_AM_COND_IF' => 1,
'AC_INIT' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_SUBST' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_FC_SRCEXT' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_FC_SRCEXT' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AM_PATH_GUILE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PATH_GUILE' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'AC_CONFIG_LINKS' => 1,
'm4_sinclude' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'm4_sinclude' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_NLS' => 1,
'AC_FC_PP_DEFINE' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'_m4_warn' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AM_PROG_CXX_C_O' => 1,
'_AM_COND_ENDIF' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'_AM_COND_ENDIF' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_SILENT_RULES' => 1,
'AM_PROG_MOC' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'LT_INIT' => 1,
'AM_PROG_AR' => 1,
'include' => 1,
'AM_GNU_GETTEXT' => 1,
'AM_PROG_AR' => 1,
'AC_LIBSOURCE' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1,
'AC_FC_PP_SRCEXT' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AH_OUTPUT' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'sinclude' => 1,
'AM_PROG_CC_C_O' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'm4_pattern_allow' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_PROG_CC_C_O' => 1,
'sinclude' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AM_POT_TOOLS' => 1,
+1 -1
View File
@@ -1,4 +1,4 @@
m4trace:configure.ac:29: -1- AC_INIT([bash], [4.3-beta2], [bug-bash@gnu.org])
m4trace:configure.ac:29: -1- AC_INIT([bash], [4.3-rc1], [bug-bash@gnu.org])
m4trace:configure.ac:29: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:29: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:29: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+18 -3
View File
@@ -120,6 +120,7 @@ static int bash_backward_kill_shellword __P((int, int));
/* Helper functions for Readline. */
static char *restore_tilde __P((char *, char *));
static char *maybe_restore_tilde __P((char *, char *));
static char *bash_filename_rewrite_hook __P((char *, int));
@@ -822,7 +823,7 @@ clear_hostname_list ()
}
/* Return a NULL terminated list of hostnames which begin with TEXT.
Initialize the hostname list the first time if neccessary.
Initialize the hostname list the first time if necessary.
The array is malloc ()'ed, but not the individual strings. */
static char **
hostnames_matching (text)
@@ -1946,7 +1947,7 @@ globword:
{
if (*hint_text == '~' && directory_part)
{
temp = restore_tilde (val, directory_part);
temp = maybe_restore_tilde (val, directory_part);
free (val);
val = temp;
}
@@ -2042,7 +2043,7 @@ globword:
/* If we performed tilde expansion, restore the original
filename. */
if (*hint_text == '~')
temp = restore_tilde (val, directory_part);
temp = maybe_restore_tilde (val, directory_part);
else
temp = savestring (val);
freetemp = 1;
@@ -2899,6 +2900,20 @@ restore_tilde (val, directory_part)
return (ret);
}
static char *
maybe_restore_tilde (val, directory_part)
char *val, *directory_part;
{
rl_icppfunc_t *save;
char *ret;
save = (dircomplete_expand == 0) ? save_directory_hook () : (rl_icppfunc_t *)0;
ret = restore_tilde (val, directory_part);
if (save)
restore_directory_hook (save);
return ret;
}
/* Simulate the expansions that will be performed by
rl_filename_completion_function. This must be called with the address of
a pointer to malloc'd memory. */
+4183
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -50,7 +50,7 @@ struct builtin {
sh_builtin_func_t *function; /* The address of the invoked function. */
int flags; /* One of the #defines above. */
char * const *long_doc; /* NULL terminated array of strings. */
const char *short_doc; /* Short version of documenation. */
const char *short_doc; /* Short version of documentation. */
char *handle; /* for future use */
};
+106 -10
View File
@@ -34,6 +34,7 @@ $PRODUCES cd.c
#if defined (HAVE_SYS_PARAM_H)
#include <sys/param.h>
#endif
#include <fcntl.h>
#include <stdio.h>
@@ -60,7 +61,10 @@ extern const char * const bash_getcwd_errstr;
static int bindpwd __P((int));
static int setpwd __P((char *));
static char *resetpwd __P((char *));
static int change_to_directory __P((char *, int));
static int change_to_directory __P((char *, int, int));
static int cdxattr __P((char *, char **));
static void resetxattr __P((void));
/* Change this to 1 to get cd spelling correction by default. */
int cdspelling = 0;
@@ -68,10 +72,12 @@ int cdspelling = 0;
int cdable_vars;
static int eflag; /* file scope so bindpwd() can see it */
static int xattrflag; /* O_XATTR support for openat */
static int xattrfd = -1;
$BUILTIN cd
$FUNCTION cd_builtin
$SHORT_DOC cd [-L|[-P [-e]]] [dir]
$SHORT_DOC cd [-L|[-P [-e]] [-@]] [dir]
Change the shell working directory.
Change the current directory to DIR. The default DIR is the value of the
@@ -94,6 +100,10 @@ Options:
of `..'
-e if the -P option is supplied, and the current working directory
cannot be determined successfully, exit with a non-zero status
#if defined (O_XATTR)
-@ on systems that support it, present a file with extended attributes
as a directory containing the file attributes
#endif
The default is to follow symbolic links, as if `-L' were specified.
`..' is processed by removing the immediately previous pathname component
@@ -177,6 +187,64 @@ resetpwd (caller)
return (tdir);
}
static int
cdxattr (dir, ndirp)
char *dir; /* don't assume we can always free DIR */
char **ndirp; /* return new constructed directory name */
{
#if defined (O_XATTR)
int apfd, fd, r, e;
char buf[11+40+40]; /* construct new `fake' path for pwd */
apfd = openat (AT_FDCWD, dir, O_RDONLY|O_NONBLOCK);
if (apfd < 0)
return -1;
fd = openat (apfd, ".", O_XATTR);
e = errno;
close (apfd); /* ignore close error for now */
errno = e;
if (fd < 0)
return -1;
r = fchdir (fd); /* assume fchdir exists everywhere with O_XATTR */
if (r < 0)
{
close (fd);
return -1;
}
/* NFSv4 and ZFS extended attribute directories do not have names which are
visible in the standard Unix directory tree structure. To ensure we have
a valid name for $PWD, we synthesize one under /proc, but to keep that
path valid, we need to keep the file descriptor open as long as we are in
this directory. This imposes a certain structure on /proc. */
sprintf (buff, "/proc/%d/fd/%d", getpid(), fd);
if (ndirp)
*ndirp = savestring (buff);
if (xattrfd >= 0)
close (xattrfd);
xattrfd = fd;
return r;
#else
return -1;
#endif
}
/* Clean up the O_XATTR baggage. Currently only closes xattrfd */
static void
resetxattr ()
{
#if defined (O_XATTR)
if (xattrfd >= 0)
{
close (xattrfd);
xattrfd = -1;
}
#else
xattrfd = -1; /* not strictly necessary */
#endif
}
#define LCD_DOVARS 0x001
#define LCD_DOSPELL 0x002
#define LCD_PRINTPATH 0x004
@@ -204,7 +272,11 @@ cd_builtin (list)
eflag = 0;
no_symlinks = no_symbolic_links;
reset_internal_getopt ();
#if defined (O_XATTR)
while ((opt = internal_getopt (list, "eLP@")) != -1)
#else
while ((opt = internal_getopt (list, "eLP")) != -1)
#endif
{
switch (opt)
{
@@ -217,6 +289,11 @@ cd_builtin (list)
case 'e':
eflag = 1;
break;
#if defined (O_XATTR)
case '@':
xattrflag = 1;
break;
#endif
default:
builtin_usage ();
return (EX_USAGE);
@@ -279,7 +356,7 @@ cd_builtin (list)
temp = sh_makepath (path, dirname, MP_DOTILDE);
free (path);
if (change_to_directory (temp, no_symlinks))
if (change_to_directory (temp, no_symlinks, xattrflag))
{
/* POSIX.2 says that if a nonempty directory from CDPATH
is used to find the directory to change to, the new
@@ -320,7 +397,7 @@ cd_builtin (list)
/* When we get here, DIRNAME is the directory to change to. If we
chdir successfully, just return. */
if (change_to_directory (dirname, no_symlinks))
if (change_to_directory (dirname, no_symlinks, xattrflag))
{
if (lflag & LCD_PRINTPATH)
printf ("%s\n", dirname);
@@ -333,7 +410,7 @@ cd_builtin (list)
if (lflag & LCD_DOVARS)
{
temp = get_string_value (dirname);
if (temp && change_to_directory (temp, no_symlinks))
if (temp && change_to_directory (temp, no_symlinks, xattrflag))
{
printf ("%s\n", temp);
return (bindpwd (no_symlinks));
@@ -346,7 +423,7 @@ cd_builtin (list)
if (lflag & LCD_DOSPELL)
{
temp = dirspell (dirname);
if (temp && change_to_directory (temp, no_symlinks))
if (temp && change_to_directory (temp, no_symlinks, xattrflag))
{
printf ("%s\n", temp);
free (temp);
@@ -448,11 +525,11 @@ pwd_builtin (list)
to the working directory. Return 1 on success, 0 on failure. */
static int
change_to_directory (newdir, nolinks)
change_to_directory (newdir, nolinks, xattr)
char *newdir;
int nolinks;
int nolinks, xattr;
{
char *t, *tdir;
char *t, *tdir, *ndir;
int err, canon_failed, r, ndlen, dlen;
tdir = (char *)NULL;
@@ -501,8 +578,27 @@ change_to_directory (newdir, nolinks)
return (0);
}
#if defined (O_XATTR)
if (xattrflag)
{
r = cdxattr (nolinks ? newdir : tdir, &ndir);
if (r >= 0)
{
canon_failed = 0;
free (tdir);
tdir = ndir;
}
}
else
#endif
{
r = chdir (nolinks ? newdir : tdir);
if (r >= 0)
resetxattr ();
}
/* If the chdir succeeds, update the_current_working_directory. */
if (chdir (nolinks ? newdir : tdir) == 0)
if (r == 0)
{
/* If canonicalization failed, but the chdir succeeded, reset the
shell's idea of the_current_working_directory. */
+651
View File
@@ -0,0 +1,651 @@
This file is cd.def, from which is created cd.c. It implements the
builtins "cd" and "pwd" in Bash.
Copyright (C) 1987-2013 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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
$PRODUCES cd.c
#include <config.h>
#if defined (HAVE_UNISTD_H)
# ifdef _MINIX
# include <sys/types.h>
# endif
# include <unistd.h>
#endif
#include "../bashtypes.h"
#include "posixdir.h"
#include "posixstat.h"
#if defined (HAVE_SYS_PARAM_H)
#include <sys/param.h>
#endif
#include <fcntl.h>
#include <stdio.h>
#include "../bashansi.h"
#include "../bashintl.h"
#include <errno.h>
#include <tilde/tilde.h>
#include "../shell.h"
#include "../flags.h"
#include "maxpath.h"
#include "common.h"
#include "bashgetopt.h"
#if !defined (errno)
extern int errno;
#endif /* !errno */
extern int posixly_correct;
extern int array_needs_making;
extern const char * const bash_getcwd_errstr;
static int bindpwd __P((int));
static int setpwd __P((char *));
static char *resetpwd __P((char *));
static int change_to_directory __P((char *, int, int));
static int cdxattr __P((char *, char **));
static void resetxattr __P((void));
/* Change this to 1 to get cd spelling correction by default. */
int cdspelling = 0;
int cdable_vars;
static int eflag; /* file scope so bindpwd() can see it */
static int xattrflag; /* O_XATTR support for openat */
static int xattrfd = -1;
$BUILTIN cd
$FUNCTION cd_builtin
$SHORT_DOC cd [-L|[-P [-e]] [-@]] [dir]
Change the shell working directory.
Change the current directory to DIR. The default DIR is the value of the
HOME shell variable.
The variable CDPATH defines the search path for the directory containing
DIR. Alternative directory names in CDPATH are separated by a colon (:).
A null directory name is the same as the current directory. If DIR begins
with a slash (/), then CDPATH is not used.
If the directory is not found, and the shell option `cdable_vars' is set,
the word is assumed to be a variable name. If that variable has a value,
its value is used for DIR.
Options:
-L force symbolic links to be followed: resolve symbolic links in
DIR after processing instances of `..'
-P use the physical directory structure without following symbolic
links: resolve symbolic links in DIR before processing instances
of `..'
-e if the -P option is supplied, and the current working directory
cannot be determined successfully, exit with a non-zero status
#if defined (O_XATTR)
-@ on systems that support it, treat a file with extended attributes
as a directory containing the file attributes
#endif
The default is to follow symbolic links, as if `-L' were specified.
`..' is processed by removing the immediately previous pathname component
back to a slash or the beginning of DIR.
Exit Status:
Returns 0 if the directory is changed, and if $PWD is set successfully when
-P is used; non-zero otherwise.
$END
/* Just set $PWD, don't change OLDPWD. Used by `pwd -P' in posix mode. */
static int
setpwd (dirname)
char *dirname;
{
int old_anm;
SHELL_VAR *tvar;
old_anm = array_needs_making;
tvar = bind_variable ("PWD", dirname ? dirname : "", 0);
if (tvar && readonly_p (tvar))
return EXECUTION_FAILURE;
if (tvar && old_anm == 0 && array_needs_making && exported_p (tvar))
{
update_export_env_inplace ("PWD=", 4, dirname ? dirname : "");
array_needs_making = 0;
}
return EXECUTION_SUCCESS;
}
static int
bindpwd (no_symlinks)
int no_symlinks;
{
char *dirname, *pwdvar;
int old_anm, r;
SHELL_VAR *tvar;
r = sh_chkwrite (EXECUTION_SUCCESS);
#define tcwd the_current_working_directory
dirname = tcwd ? (no_symlinks ? sh_physpath (tcwd, 0) : tcwd)
: get_working_directory ("cd");
#undef tcwd
old_anm = array_needs_making;
pwdvar = get_string_value ("PWD");
tvar = bind_variable ("OLDPWD", pwdvar, 0);
if (tvar && readonly_p (tvar))
r = EXECUTION_FAILURE;
if (old_anm == 0 && array_needs_making && exported_p (tvar))
{
update_export_env_inplace ("OLDPWD=", 7, pwdvar);
array_needs_making = 0;
}
if (setpwd (dirname) == EXECUTION_FAILURE)
r = EXECUTION_FAILURE;
if (dirname == 0 && eflag)
r = EXECUTION_FAILURE;
if (dirname && dirname != the_current_working_directory)
free (dirname);
return (r);
}
/* Call get_working_directory to reset the value of
the_current_working_directory () */
static char *
resetpwd (caller)
char *caller;
{
char *tdir;
FREE (the_current_working_directory);
the_current_working_directory = (char *)NULL;
tdir = get_working_directory (caller);
return (tdir);
}
static int
cdxattr (dir, ndirp)
char *dir; /* don't assume we can always free DIR */
char **ndirp; /* return new constructed directory name */
{
#if defined (O_XATTR)
int apfd, fd, r, e;
char buf[11+40+40]; /* construct new `fake' path for pwd */
apfd = openat (AT_FDCWD, dir, O_RDONLY|O_NONBLOCK);
if (apfd < 0)
return -1;
fd = openat (apfd, ".", O_XATTR);
e = errno;
close (apfd); /* ignore close error for now */
errno = e;
if (fd < 0)
return -1;
r = fchdir (fd); /* assume fchdir exists everywhere with O_XATTR */
if (r < 0)
{
close (fd);
return -1;
}
/* NFSv4 and ZFS extended attribute directories do not have names which are
visible in the standard Unix directory tree structure. To ensure we have
a valid name for $PWD, we synthesize one under /proc, but to keep that
path valid, we need to keep the file descriptor open as long as we are in
this directory. This imposes a certain structure on /proc. */
sprintf (buff, "/proc/%d/fd/%d", getpid(), fd);
if (ndirp)
*ndirp = savestring (buff);
if (xattrfd >= 0)
close (xattrfd);
xattrfd = fd;
return r;
#else
return -1;
#endif
}
/* Clean up the O_XATTR baggage. Currently only closes xattrfd */
static void
resetxattr ()
{
#if defined (O_XATTR)
if (xattrfd >= 0)
{
close (xattrfd);
xattrfd = -1;
}
#else
xattrfd = -1; /* not strictly necessary */
#endif
}
#define LCD_DOVARS 0x001
#define LCD_DOSPELL 0x002
#define LCD_PRINTPATH 0x004
#define LCD_FREEDIRNAME 0x008
/* This builtin is ultimately the way that all user-visible commands should
change the current working directory. It is called by cd_to_string (),
so the programming interface is simple, and it handles errors and
restrictions properly. */
int
cd_builtin (list)
WORD_LIST *list;
{
char *dirname, *cdpath, *path, *temp;
int path_index, no_symlinks, opt, lflag;
#if defined (RESTRICTED_SHELL)
if (restricted)
{
sh_restricted ((char *)NULL);
return (EXECUTION_FAILURE);
}
#endif /* RESTRICTED_SHELL */
eflag = 0;
no_symlinks = no_symbolic_links;
reset_internal_getopt ();
#if defined (O_XATTR)
while ((opt = internal_getopt (list, "eLP@")) != -1)
#else
while ((opt = internal_getopt (list, "eLP")) != -1)
#endif
{
switch (opt)
{
case 'P':
no_symlinks = 1;
break;
case 'L':
no_symlinks = 0;
break;
case 'e':
eflag = 1;
break;
#if defined (O_XATTR)
case '@':
xattrflag = 1;
break;
#endif
default:
builtin_usage ();
return (EX_USAGE);
}
}
list = loptend;
lflag = (cdable_vars ? LCD_DOVARS : 0) |
((interactive && cdspelling) ? LCD_DOSPELL : 0);
if (eflag && no_symlinks == 0)
eflag = 0;
if (list == 0)
{
/* `cd' without arguments is equivalent to `cd $HOME' */
dirname = get_string_value ("HOME");
if (dirname == 0)
{
builtin_error (_("HOME not set"));
return (EXECUTION_FAILURE);
}
lflag = 0;
}
#if defined (CD_COMPLAINS)
else if (list->next)
{
builtin_error (_("too many arguments"));
return (EXECUTION_FAILURE);
}
#endif
else if (list->word->word[0] == '-' && list->word->word[1] == '\0')
{
/* This is `cd -', equivalent to `cd $OLDPWD' */
dirname = get_string_value ("OLDPWD");
if (dirname == 0)
{
builtin_error (_("OLDPWD not set"));
return (EXECUTION_FAILURE);
}
#if 0
lflag = interactive ? LCD_PRINTPATH : 0;
#else
lflag = LCD_PRINTPATH; /* According to SUSv3 */
#endif
}
else if (absolute_pathname (list->word->word))
dirname = list->word->word;
else if (privileged_mode == 0 && (cdpath = get_string_value ("CDPATH")))
{
dirname = list->word->word;
/* Find directory in $CDPATH. */
path_index = 0;
while (path = extract_colon_unit (cdpath, &path_index))
{
/* OPT is 1 if the path element is non-empty */
opt = path[0] != '\0';
temp = sh_makepath (path, dirname, MP_DOTILDE);
free (path);
if (change_to_directory (temp, no_symlinks, xattrflag))
{
/* POSIX.2 says that if a nonempty directory from CDPATH
is used to find the directory to change to, the new
directory name is echoed to stdout, whether or not
the shell is interactive. */
if (opt && (path = no_symlinks ? temp : the_current_working_directory))
printf ("%s\n", path);
free (temp);
#if 0
/* Posix.2 says that after using CDPATH, the resultant
value of $PWD will not contain `.' or `..'. */
return (bindpwd (posixly_correct || no_symlinks));
#else
return (bindpwd (no_symlinks));
#endif
}
else
free (temp);
}
#if 0
/* changed for bash-4.2 Posix cd description steps 5-6 */
/* POSIX.2 says that if `.' does not appear in $CDPATH, we don't
try the current directory, so we just punt now with an error
message if POSIXLY_CORRECT is non-zero. The check for cdpath[0]
is so we don't mistakenly treat a CDPATH value of "" as not
specifying the current directory. */
if (posixly_correct && cdpath[0])
{
builtin_error ("%s: %s", dirname, strerror (ENOENT));
return (EXECUTION_FAILURE);
}
#endif
}
else
dirname = list->word->word;
/* When we get here, DIRNAME is the directory to change to. If we
chdir successfully, just return. */
if (change_to_directory (dirname, no_symlinks, xattrflag))
{
if (lflag & LCD_PRINTPATH)
printf ("%s\n", dirname);
return (bindpwd (no_symlinks));
}
/* If the user requests it, then perhaps this is the name of
a shell variable, whose value contains the directory to
change to. */
if (lflag & LCD_DOVARS)
{
temp = get_string_value (dirname);
if (temp && change_to_directory (temp, no_symlinks, xattrflag))
{
printf ("%s\n", temp);
return (bindpwd (no_symlinks));
}
}
/* If the user requests it, try to find a directory name similar in
spelling to the one requested, in case the user made a simple
typo. This is similar to the UNIX 8th and 9th Edition shells. */
if (lflag & LCD_DOSPELL)
{
temp = dirspell (dirname);
if (temp && change_to_directory (temp, no_symlinks, xattrflag))
{
printf ("%s\n", temp);
free (temp);
return (bindpwd (no_symlinks));
}
else
FREE (temp);
}
builtin_error ("%s: %s", dirname, strerror (errno));
return (EXECUTION_FAILURE);
}
$BUILTIN pwd
$FUNCTION pwd_builtin
$SHORT_DOC pwd [-LP]
Print the name of the current working directory.
Options:
-L print the value of $PWD if it names the current working
directory
-P print the physical directory, without any symbolic links
By default, `pwd' behaves as if `-L' were specified.
Exit Status:
Returns 0 unless an invalid option is given or the current directory
cannot be read.
$END
/* Non-zero means that pwd always prints the physical directory, without
symbolic links. */
static int verbatim_pwd;
/* Print the name of the current working directory. */
int
pwd_builtin (list)
WORD_LIST *list;
{
char *directory;
int opt, pflag;
verbatim_pwd = no_symbolic_links;
pflag = 0;
reset_internal_getopt ();
while ((opt = internal_getopt (list, "LP")) != -1)
{
switch (opt)
{
case 'P':
verbatim_pwd = pflag = 1;
break;
case 'L':
verbatim_pwd = 0;
break;
default:
builtin_usage ();
return (EX_USAGE);
}
}
list = loptend;
#define tcwd the_current_working_directory
directory = tcwd ? (verbatim_pwd ? sh_physpath (tcwd, 0) : tcwd)
: get_working_directory ("pwd");
/* Try again using getcwd() if canonicalization fails (for instance, if
the file system has changed state underneath bash). */
if ((tcwd && directory == 0) ||
(posixly_correct && same_file (".", tcwd, (struct stat *)0, (struct stat *)0) == 0))
{
if (directory && directory != tcwd)
free (directory);
directory = resetpwd ("pwd");
}
#undef tcwd
if (directory)
{
opt = EXECUTION_SUCCESS;
printf ("%s\n", directory);
/* This is dumb but posix-mandated. */
if (posixly_correct && pflag)
opt = setpwd (directory);
if (directory != the_current_working_directory)
free (directory);
return (sh_chkwrite (opt));
}
else
return (EXECUTION_FAILURE);
}
/* Do the work of changing to the directory NEWDIR. Handle symbolic
link following, etc. This function *must* return with
the_current_working_directory either set to NULL (in which case
getcwd() will eventually be called), or set to a string corresponding
to the working directory. Return 1 on success, 0 on failure. */
static int
change_to_directory (newdir, nolinks, xattr)
char *newdir;
int nolinks, xattr;
{
char *t, *tdir, *ndir;
int err, canon_failed, r, ndlen, dlen;
tdir = (char *)NULL;
if (the_current_working_directory == 0)
{
t = get_working_directory ("chdir");
FREE (t);
}
t = make_absolute (newdir, the_current_working_directory);
/* TDIR is either the canonicalized absolute pathname of NEWDIR
(nolinks == 0) or the absolute physical pathname of NEWDIR
(nolinks != 0). */
tdir = nolinks ? sh_physpath (t, 0)
: sh_canonpath (t, PATH_CHECKDOTDOT|PATH_CHECKEXISTS);
ndlen = strlen (newdir);
dlen = strlen (t);
/* Use the canonicalized version of NEWDIR, or, if canonicalization
failed, use the non-canonical form. */
canon_failed = 0;
if (tdir && *tdir)
free (t);
else
{
FREE (tdir);
tdir = t;
canon_failed = 1;
}
/* In POSIX mode, if we're resolving symlinks logically and sh_canonpath
returns NULL (because it checks the path, it will return NULL if the
resolved path doesn't exist), fail immediately. */
if (posixly_correct && nolinks == 0 && canon_failed && (errno != ENAMETOOLONG || ndlen > PATH_MAX))
{
#if defined ENAMETOOLONG
if (errno != ENOENT && errno != ENAMETOOLONG)
#else
if (errno != ENOENT)
#endif
errno = ENOTDIR;
free (tdir);
return (0);
}
#if defined (O_XATTR)
if (xattrflag)
{
r = cdxattr (nolinks ? newdir : tdir, &ndir);
if (r >= 0)
{
canon_failed = 0;
free (tdir);
tdir = ndir;
}
}
else
#endif
{
r = chdir (nolinks ? newdir : tdir);
if (r >= 0)
resetxattr ();
}
/* If the chdir succeeds, update the_current_working_directory. */
if (r == 0)
{
/* If canonicalization failed, but the chdir succeeded, reset the
shell's idea of the_current_working_directory. */
if (canon_failed)
{
t = resetpwd ("cd");
if (t == 0)
set_working_directory (tdir);
else
free (t);
}
else
set_working_directory (tdir);
free (tdir);
return (1);
}
/* We failed to change to the appropriate directory name. If we tried
what the user passed (nolinks != 0), punt now. */
if (nolinks)
{
free (tdir);
return (0);
}
err = errno;
/* We're not in physical mode (nolinks == 0), but we failed to change to
the canonicalized directory name (TDIR). Try what the user passed
verbatim. If we succeed, reinitialize the_current_working_directory. */
if (chdir (newdir) == 0)
{
t = resetpwd ("cd");
if (t == 0)
set_working_directory (tdir);
else
free (t);
r = 1;
}
else
{
errno = err;
r = 0;
}
free (tdir);
return r;
}
+4 -4
View File
@@ -202,7 +202,7 @@ void remove_trailing_whitespace ();
/* For each file mentioned on the command line, process it and
write the information to STRUCTFILE and EXTERNFILE, while
creating the production file if neccessary. */
creating the production file if necessary. */
int
main (argc, argv)
int argc;
@@ -399,7 +399,7 @@ copy_string_array (array)
return (copy);
}
/* Add ELEMENT to ARRAY, growing the array if neccessary. */
/* Add ELEMENT to ARRAY, growing the array if necessary. */
void
array_add (element, array)
char *element;
@@ -1148,7 +1148,7 @@ char *structfile_footer[] = {
(char *)NULL
};
/* Write out any neccessary opening information for
/* Write out any necessary opening information for
STRUCTFILE and EXTERNFILE. */
void
write_file_headers (structfile, externfile)
@@ -1263,7 +1263,7 @@ write_builtins (defs, structfile, externfile)
long documentation strings. */
save_builtin (builtin);
/* Write out the matching #endif, if neccessary. */
/* Write out the matching #endif, if necessary. */
if (builtin->dependencies)
{
if (externfile)
+1 -1
View File
@@ -27,7 +27,7 @@ echo ""
#
# Try to avoid tempfile races. We can't really check for the file's
# existance before we run psize.aux, because `test -e' is not portable,
# existence before we run psize.aux, because `test -e' is not portable,
# `test -h' (test for symlinks) is not portable, and `test -f' only
# checks for regular files. If we used mktemp(1), we're ahead of the
# game.
+1 -1
View File
@@ -299,7 +299,7 @@ typedef struct arith_com {
} ARITH_COM;
#endif /* DPAREN_ARITHMETIC */
/* The conditional command, [[...]]. This is a binary tree -- we slippped
/* The conditional command, [[...]]. This is a binary tree -- we slipped
a recursive-descent parser into the YACC grammar to parse it. */
#define COND_AND 1
#define COND_OR 2
Vendored
+11 -11
View File
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac for Bash 4.3, version 4.059.
# From configure.ac for Bash 4.3, version 4.060.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for bash 4.3-beta2.
# Generated by GNU Autoconf 2.69 for bash 4.3-rc1.
#
# Report bugs to <bug-bash@gnu.org>.
#
@@ -581,8 +581,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='bash'
PACKAGE_TARNAME='bash'
PACKAGE_VERSION='4.3-beta2'
PACKAGE_STRING='bash 4.3-beta2'
PACKAGE_VERSION='4.3-rc1'
PACKAGE_STRING='bash 4.3-rc1'
PACKAGE_BUGREPORT='bug-bash@gnu.org'
PACKAGE_URL=''
@@ -1393,7 +1393,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures bash 4.3-beta2 to adapt to many kinds of systems.
\`configure' configures bash 4.3-rc1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1458,7 +1458,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bash 4.3-beta2:";;
short | recursive ) echo "Configuration of bash 4.3-rc1:";;
esac
cat <<\_ACEOF
@@ -1650,7 +1650,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bash configure 4.3-beta2
bash configure 4.3-rc1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2359,7 +2359,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bash $as_me 4.3-beta2, which was
It was created by bash $as_me 4.3-rc1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2753,7 +2753,7 @@ ac_config_headers="$ac_config_headers config.h"
BASHVERS=4.3
RELSTATUS=beta2
RELSTATUS=rc1
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
@@ -16539,7 +16539,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by bash $as_me 4.3-beta2, which was
This file was extended by bash $as_me 4.3-rc1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16605,7 +16605,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
bash config.status 4.3-beta2
bash config.status 4.3-rc1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
+2 -2
View File
@@ -21,10 +21,10 @@ dnl Process this file with autoconf to produce a configure script.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_REVISION([for Bash 4.3, version 4.059])dnl
AC_REVISION([for Bash 4.3, version 4.060])dnl
define(bashvers, 4.3)
define(relstatus, beta2)
define(relstatus, rc1)
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
+3 -3
View File
@@ -179,7 +179,7 @@ variable expansion semantics, redirection, and quoting as the
Bourne shell. Where differences appear between the POSIX.2
standard and traditional sh behavior, Bash follows POSIX.
.PP
The Korn Shell (\fBksh\fP) is a descendent of the Bourne shell written
The Korn Shell (\fBksh\fP) is a descendant of the Bourne shell written
at AT&T Bell Laboratories by David Korn\(dg. It provides a number of
useful features that POSIX and Bash have adopted. Many of the
interactive facilities in POSIX.2 have their roots in the ksh:
@@ -491,7 +491,7 @@ some bindings, and begin to use them almost immediately.
.PP
Bash implements the
.B bind
builtin for more dyamic control of readline than the startup file
builtin for more dynamic control of readline than the startup file
permits.
.B Bind
is used in several ways. In
@@ -544,7 +544,7 @@ and
builtins to manipulate the history list.
The value of
.B $HISTFILE
specifes the file where Bash writes the command history on exit and
specifies the file where Bash writes the command history on exit and
reads it on startup.
.B $HISTSIZE
is used to limit the number of commands saved in the history.
+14 -8
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Mon Sep 2 12:21:48 EDT 2013
.\" Last Change: Sun Oct 20 22:13:29 EDT 2013
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2013 September 2" "GNU Bash 4.3"
.TH BASH 1 "2013 October 20" "GNU Bash 4.3"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -2595,14 +2595,18 @@ words. There are seven kinds of expansion performed:
and
.IR "pathname expansion" .
.PP
The order of expansions is: brace expansion, tilde expansion,
parameter, variable and arithmetic expansion and
command substitution
(done in a left-to-right fashion), word splitting, and pathname
expansion.
The order of expansions is:
brace expansion;
tilde expansion, parameter and variable expansion, arithmetic expansion,
and command substitution (done in a left-to-right fashion);
word splitting;
and pathname expansion.
.PP
On systems that can support it, there is an additional expansion
available: \fIprocess substitution\fP.
This is performed at the
same time as tilde, parameter, variable, and arithmetic expansion and
command substitution.
.PP
Only brace expansion, word splitting, and pathname expansion
can change the number of words of the expansion; other expansions
@@ -7022,7 +7026,7 @@ The return value is 0 unless the shell is not executing a subroutine
call or \fIexpr\fP does not correspond to a valid position in the
call stack.
.TP
\fBcd\fP [\fB\-L\fP|[\fB\-P\fP [\fB\-e\fP]]] [\fIdir\fP]
\fBcd\fP [\fB\-L\fP|[\fB\-P\fP [\fB\-e\fP]] [\-@]] [\fIdir\fP]
Change the current directory to \fIdir\fP.
if \fIdir\fP is not supplied, the value of the
.SM
@@ -7072,6 +7076,8 @@ option is supplied with
and the current working directory cannot be successfully determined
after a successful directory change, \fBcd\fP will return an unsuccessful
status.
On systems that support it, the \fB\-@\fP option presents the extended
attributes associated with a file as a directory.
An argument of
.B \-
is converted to
+10315
View File
File diff suppressed because it is too large Load Diff
+14 -8
View File
@@ -1666,15 +1666,17 @@ Expansion is performed on the command line after it has been split into
words.
@end menu
The order of expansions is: brace expansion, tilde expansion,
parameter, variable, and arithmetic expansion and
command substitution
(done in a left-to-right fashion), word splitting, and filename
expansion.
The order of expansions is:
brace expansion;
tilde expansion, parameter and variable expansion, arithmetic expansion,
and command substitution (done in a left-to-right fashion);
word splitting;
and filename expansion.
On systems that can support it, there is an additional expansion
available: @var{process substitution}. This is performed at the
same time as parameter, variable, and arithmetic expansion and
available: @var{process substitution}.
This is performed at the
same time as tilde, parameter, variable, and arithmetic expansion and
command substitution.
Only brace expansion, word splitting, and filename expansion
@@ -3227,7 +3229,7 @@ The return status is zero unless @var{n} is not greater than or equal to 1.
@item cd
@btindex cd
@example
cd [-L|[-P [-e]]] [@var{directory}]
cd [-L|[-P [-e]] [-@@] [@var{directory}]
@end example
Change the current working directory to @var{directory}.
@@ -3257,6 +3259,10 @@ If the @option{-e} option is supplied with @option{-P}
and the current working directory cannot be successfully determined
after a successful directory change, @code{cd} will return an unsuccessful
status.
On systems that support it, the @option{-@@} option presents the extended
attributes associated with a file as a directory.
If @var{directory} is @samp{-}, it is converted to @env{$OLDPWD}
before the directory change is attempted.
+8727
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -2,9 +2,9 @@
Copyright (C) 1988-2013 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Mon Sep 2 12:21:28 EDT 2013
@set LASTCHANGE Sun Oct 20 22:15:33 EDT 2013
@set EDITION 4.3
@set VERSION 4.3
@set UPDATED 2 September 2013
@set UPDATED-MONTH September 2013
@set UPDATED 20 October 2013
@set UPDATED-MONTH October 2013
+10
View File
@@ -0,0 +1,10 @@
@ignore
Copyright (C) 1988-2013 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Mon Oct 14 11:51:31 EDT 2013
@set EDITION 4.3
@set VERSION 4.3
@set UPDATED 14 October 2013
@set UPDATED-MONTH October 2013
+1 -1
View File
@@ -59,7 +59,7 @@ extern void command_error __P((const char *, int, int, int));
extern char *command_errstr __P((int));
/* Specific errror message functions that eventually call report_error or
/* Specific error message functions that eventually call report_error or
internal_error. */
extern void err_badarraysub __P((const char *));
+1 -1
View File
@@ -95,7 +95,7 @@ reader_loop ()
switch (code)
{
/* Some kind of throw to top_level has occured. */
/* Some kind of throw to top_level has occurred. */
case FORCE_EOF:
case ERREXIT:
case EXITPROG:
+1 -1
View File
@@ -143,7 +143,7 @@
</tr>
<tr>
<td>./functions/keep</td>
<td>Try to keep some programs in the forground and running.</td>
<td>Try to keep some programs in the foreground and running.</td>
</tr>
<tr>
<td>./functions/ksh-cd</td>
+1 -1
View File
@@ -32,7 +32,7 @@ Path Description X-Ref
./functions/isvalidip Test user input for valid IP Addresses.
./functions/jdate.bash Julian date conversion.
./functions/jj.bash Look for running jobs.
./functions/keep Try to keep some programs in the forground and running.
./functions/keep Try to keep some programs in the foreground and running.
./functions/ksh-cd ksh-like 'cd': cd [-LP] [dir [change]]. ksh
./functions/ksh-compat-test ksh-like arithmetic test replacements. ksh
./functions/kshenv Functions and aliases to provide the beginnings of a ksh environment for bash. ksh
+2 -2
View File
@@ -514,7 +514,7 @@ async_redirect_stdin ()
#define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0)
/* Execute the command passed in COMMAND, perhaps doing it asynchrounously.
/* Execute the command passed in COMMAND, perhaps doing it asynchronously.
COMMAND is exactly what read_command () places into GLOBAL_COMMAND.
ASYNCHROUNOUS, if non-zero, says to do this command in the background.
PIPE_IN and PIPE_OUT are file descriptors saying where input comes
@@ -4054,7 +4054,7 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
goto return_result;
}
/* One other possiblilty. The user may want to resume an existing job.
/* One other possibililty. The user may want to resume an existing job.
If they do, find out whether this word is a candidate for a running
job. */
if (job_control && already_forked == 0 && async == 0 &&
+5413
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -88,7 +88,7 @@
Here is a macro which accepts newlines, tabs and spaces as whitespace. */
#define cr_whitespace(c) (whitespace(c) || ((c) == '\n'))
/* Size be which the expression stack grows when neccessary. */
/* Size be which the expression stack grows when necessary. */
#define EXPR_STACK_GROW_SIZE 10
/* Maximum amount of recursion allowed. This prevents a non-integer
+1 -1
View File
@@ -124,7 +124,7 @@ typedef struct {
int token;
} STRING_INT_ALIST;
/* A macro to avoid making an uneccessary function call. */
/* A macro to avoid making an unneccessary function call. */
#define REVERSE_LIST(list, type) \
((list && list->next) ? (type)list_reverse ((GENERIC_LIST *)list) \
: (type)(list))
+1 -1
View File
@@ -467,7 +467,7 @@ extern int locale_mb_cur_max; /* XXX */
# define SADD_MBCHAR(_dst, _src, _si, _srcsize)
#endif
/* Watch out when using this -- it's just straight textual subsitution */
/* Watch out when using this -- it's just straight textual substitution */
#if defined (HANDLE_MULTIBYTE)
# define SADD_MBQCHAR_BODY(_dst, _src, _si, _srcsize) \
\
+1 -1
View File
@@ -45,7 +45,7 @@ struct tms
};
/* Store the CPU time used by this process and all its
dead descendents in BUFFER.
dead descendants in BUFFER.
Return the elapsed real time from an arbitrary point in the
past (the bash emulation uses the epoch), or (clock_t) -1 for
errors. All times are in CLK_TCKths of a second. */
+1 -1
View File
@@ -457,7 +457,7 @@ close_buffered_fd (fd)
return (close_buffered_stream (buffers[fd]));
}
/* Make the BUFFERED_STREAM associcated with buffers[FD] be BP, and return
/* Make the BUFFERED_STREAM associated with buffers[FD] be BP, and return
the old BUFFERED_STREAM. */
BUFFERED_STREAM *
set_buffered_stream (fd, bp)
+2 -2
View File
@@ -239,7 +239,7 @@ skipname (pat, dname, flags)
(dname[1] == '\0' || (dname[1] == '.' && dname[2] == '\0'))))
return 1;
/* If a dot must be explicity matched, check to see if they do. */
/* If a dot must be explicitly matched, check to see if they do. */
else if (noglob_dot_filenames && dname[0] == '.' && pat[0] != '.' &&
(pat[0] != '\\' || pat[1] != '.'))
return 1;
@@ -261,7 +261,7 @@ wchkname (pat_wc, dn_wc)
(dn_wc[1] == L'\0' || (dn_wc[1] == L'.' && dn_wc[2] == L'\0'))))
return 1;
/* If a leading dot must be explicity matched, check to see if the
/* If a leading dot must be explicitly matched, check to see if the
pattern and dirname both have one. */
else if (noglob_dot_filenames && dn_wc[0] == L'.' &&
pat_wc[0] != L'.' &&
+1 -1
View File
@@ -272,7 +272,7 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
}
if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
{
/* This component can be part of both syntaces but has different
/* This component can be part of both syntaxes but has different
leading characters. For CEN we use `+', else `@'. */
*cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
cp = stpcpy (cp, modifier);
+1 -1
View File
@@ -1424,7 +1424,7 @@ postprocess_matches (matchesp, matching_filenames)
return 0;
/* It seems to me that in all the cases we handle we would like
to ignore duplicate possiblilities. Scan for the text to
to ignore duplicate possibilities. Scan for the text to
insert being identical to the other completions. */
if (rl_ignore_completion_duplicates)
{
+2 -2
View File
@@ -1345,7 +1345,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
size_t ret;
/* This fixes only double-column characters, but if the wrapped
character comsumes more than three columns, spaces will be
character consumes more than three columns, spaces will be
inserted in the string buffer. */
if (current_line < line_state_visible->wbsize && line_state_visible->wrapped_line[current_line] > 0)
_rl_clear_to_eol (line_state_visible->wrapped_line[current_line]);
@@ -1611,7 +1611,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
o_cpos = _rl_last_c_pos;
/* When this function returns, _rl_last_c_pos is correct, and an absolute
cursor postion in multibyte mode, but a buffer index when not in a
cursor position in multibyte mode, but a buffer index when not in a
multibyte locale. */
_rl_move_cursor_relative (od, old);
+1 -1
View File
@@ -377,7 +377,7 @@ if the returned line should be displayed, but not executed,
as with the @code{:p} modifier (@pxref{Modifiers}).
@end table
If an error ocurred in expansion, then @var{output} contains a descriptive
If an error occurred in expansion, then @var{output} contains a descriptive
error message.
@end deftypefun
+6 -6
View File
@@ -195,7 +195,7 @@ For Readline 4.2, for example, the value of
@node Readline Typedefs
@subsection Readline Typedefs
For readabilty, we declare a number of new object types, all pointers
For readability, we declare a number of new object types, all pointers
to functions.
The reason for declaring these new types is to make it easier to write
@@ -519,7 +519,7 @@ whether a particular state bit is set. Current state bits include:
@table @code
@item RL_STATE_NONE
Readline has not yet been called, nor has it begun to intialize.
Readline has not yet been called, nor has it begun to initialize.
@item RL_STATE_INITIALIZING
Readline is initializing its internal data structures.
@item RL_STATE_INITIALIZED
@@ -941,7 +941,7 @@ Readline thinks the screen display is correct.
@deftypefun int rl_on_new_line (void)
Tell the update functions that we have moved onto a new (empty) line,
usually after ouputting a newline.
usually after outputting a newline.
@end deftypefun
@deftypefun int rl_on_new_line_with_prompt (void)
@@ -1287,7 +1287,7 @@ Readline saves in the history list.
An alternate interface is available to plain @code{readline()}. Some
applications need to interleave keyboard I/O with file, device, or
window system I/O, typically by using a main loop to @code{select()}
on various file descriptors. To accomodate this need, readline can
on various file descriptors. To accommodate this need, readline can
also be invoked as a `callback' function from an event loop. There
are functions available to make this easy.
@@ -1755,7 +1755,7 @@ This calls @code{rl_complete_internal()} with an argument of @samp{*}.
@end deftypefun
@deftypefun int rl_completion_mode (rl_command_func_t *cfunc)
Returns the apppriate value to pass to @code{rl_complete_internal()}
Returns the appropriate value to pass to @code{rl_complete_internal()}
depending on whether @var{cfunc} was called twice in succession and
the values of the @code{show-all-if-ambiguous} and
@code{show-all-if-unmodified} variables.
@@ -1910,7 +1910,7 @@ The function should not modify the directory argument if it returns 0.
If non-zero, this is the address of a function called when reading
directory entries from the filesystem for completion and comparing
them to the partial word to be completed. The function should
perform any necesary application or system-specific conversion on
perform any necessary application or system-specific conversion on
the filename, such as converting between character sets or converting
from a filesystem format to a character input format.
The function takes two arguments: @var{fname}, the filename to be converted,
+1 -1
View File
@@ -915,7 +915,7 @@ binding, variable assignment, and conditional syntax.
# You can re-read the inputrc file with C-x C-r.
# Lines beginning with '#' are comments.
#
# First, include any systemwide bindings and variable
# First, include any system-wide bindings and variable
# assignments from /etc/Inputrc
$include /etc/Inputrc
+1 -1
View File
@@ -831,7 +831,7 @@ history_expand_internal (string, start, qc, end_index_ptr, ret_string, current_l
}
i += 2;
}
/* Done with modfiers. */
/* Done with modifiers. */
/* Believe it or not, we have to back the pointer up by one. */
--i;
+1 -1
View File
@@ -216,7 +216,7 @@ extern int history_truncate_file PARAMS((const char *, int));
-1) If there was an error in expansion.
2) If the returned line should just be printed.
If an error ocurred in expansion, then OUTPUT contains a descriptive
If an error occurred in expansion, then OUTPUT contains a descriptive
error message. */
extern int history_expand PARAMS((char *, char **));
+1 -1
View File
@@ -529,7 +529,7 @@ rl_getc (stream)
the read to be interrupted if we caught SIGHUP or SIGTERM (but
not SIGINT; let the signal handler deal with that), but if the
application sets an event hook, call it for other signals.
Otherwise (not EINTR), some error ocurred, also signifying EOF. */
Otherwise (not EINTR), some error occurred, also signifying EOF. */
if (errno != EINTR)
return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM)
+1 -1
View File
@@ -221,7 +221,7 @@ _rl_isearch_init (direction)
cxt->search_terminators = _rl_isearch_terminators ? _rl_isearch_terminators
: default_isearch_terminators;
/* Create an arrary of pointers to the lines that we want to search. */
/* Create an array of pointers to the lines that we want to search. */
hlist = history_list ();
rl_maybe_replace_line ();
i = 0;
+2 -2
View File
@@ -237,7 +237,7 @@ int rl_erase_empty_line = 0;
character bound to accept-line. */
int rl_num_chars_to_read;
/* Line buffer and maintenence. */
/* Line buffer and maintenance. */
char *rl_line_buffer = (char *)NULL;
int rl_line_buffer_len = 0;
@@ -1053,7 +1053,7 @@ rl_initialize ()
RL_SETSTATE(RL_STATE_INITIALIZED);
}
/* Initalize the current line information. */
/* Initialize the current line information. */
_rl_init_line_state ();
/* We aren't done yet. We haven't even gotten started yet! */
+1 -1
View File
@@ -240,7 +240,7 @@ rl_replace_line (text, clear_undo)
this is the same as rl_end.
Any command that is called interactively receives two arguments.
The first is a count: the numeric arg pased to this command.
The first is a count: the numeric arg passed to this command.
The second is the key which invoked this command.
*/
+1 -1
View File
@@ -124,7 +124,7 @@ dup2 (fd1, fd2)
/*
* Return the total number of available file descriptors.
*
* On some systems, like 4.2BSD and its descendents, there is a system call
* On some systems, like 4.2BSD and its descendants, there is a system call
* that returns the size of the descriptor table: getdtablesize(). There are
* lots of ways to emulate this on non-BSD systems.
*
+1 -1
View File
@@ -592,7 +592,7 @@ integral(real, ip)
/*
* return an ascii representation of the integral part of the number
* and set fract to be an ascii representation of the fraction part
* the container for the fraction and the integral part or staticly
* the container for the fraction and the integral part or statically
* declare with fix size
*/
static char *
+1 -1
View File
@@ -29,7 +29,7 @@
#include <stdc.h>
/* Find the first ocurrence in S of any character in ACCEPT. */
/* Find the first occurrence in S of any character in ACCEPT. */
char *
strpbrk (s, accept)
register const char *s;
+1 -1
View File
@@ -50,7 +50,7 @@ typedef ssize_t creadfunc_t __P((int, char *));
The differences are
(1) using file descriptor instead of FILE *,
(2) the order of arguments; the file descriptor comes the first, and
(3) the addtion of thired argument, UNBUFFERED_READ; this argument
(3) the addition of third argument, UNBUFFERED_READ; this argument
controls whether get_line uses buffering or not to get a byte data
from FD. get_line uses zreadc if UNBUFFERED_READ is zero; and
uses zread if UNBUFFERED_READ is non-zero.
+1 -1
View File
@@ -45,7 +45,7 @@
#define PST_REGEXP 0x010000 /* parsing an ERE/BRE as a single word */
#define PST_HEREDOC 0x020000 /* reading body of here-document */
#define PST_REPARSE 0x040000 /* re-parsing in parse_string_to_word_list */
#define PST_REDIRLIST 0x080000 /* parsing a list of redirctions preceding a simple command name */
#define PST_REDIRLIST 0x080000 /* parsing a list of redirections preceding a simple command name */
/* Definition of the delimiter stack. Needed by parse.y and bashhist.c. */
+1 -1
View File
@@ -23,7 +23,7 @@
#include "sig.h" /* for sig_atomic_t */
/* Non-zero means SIGINT has already ocurred. */
/* Non-zero means SIGINT has already occurred. */
extern volatile sig_atomic_t interrupt_state;
extern volatile sig_atomic_t terminating_signal;
+2 -2
View File
@@ -205,7 +205,7 @@ expandable_filename:
/* Perform the redirections on LIST. If flags & RX_ACTIVE, then actually
make input and output file descriptors, otherwise just do whatever is
neccessary for side effecting. flags & RX_UNDOABLE says to remember
necessary for side effecting. flags & RX_UNDOABLE says to remember
how to undo the redirections later, if non-zero. If flags & RX_CLEXEC
is non-zero, file descriptors opened in do_redirection () have their
close-on-exec flag set. */
@@ -702,7 +702,7 @@ undoablefd (fd)
/* Do the specific redirection requested. Returns errno or one of the
special redirection errors (*_REDIRECT) in case of error, 0 on success.
If flags & RX_ACTIVE is zero, then just do whatever is neccessary to
If flags & RX_ACTIVE is zero, then just do whatever is necessary to
produce the appropriate side effects. flags & RX_UNDOABLE, if non-zero,
says to remember how to undo each redirection. If flags & RX_CLEXEC is
non-zero, then we set all file descriptors > 2 that we open to be
+2 -2
View File
@@ -1246,7 +1246,7 @@ run_wordexp (words)
{
switch (code)
{
/* Some kind of throw to top_level has occured. */
/* Some kind of throw to top_level has occurred. */
case FORCE_EOF:
return last_command_exit_value = 127;
case ERREXIT:
@@ -1324,7 +1324,7 @@ run_one_command (command)
#endif /* PROCESS_SUBSTITUTION */
switch (code)
{
/* Some kind of throw to top_level has occured. */
/* Some kind of throw to top_level has occurred. */
case FORCE_EOF:
return last_command_exit_value = 127;
case ERREXIT:
+4 -4
View File
@@ -2324,7 +2324,7 @@ string_list_dollar_at (list, quoted)
return ret;
}
/* Turn the positional paramters into a string, understanding quoting and
/* Turn the positional parameters into a string, understanding quoting and
the various subtleties of using the first character of $IFS as the
separator. Calls string_list_dollar_at, string_list_dollar_star, and
string_list as appropriate. */
@@ -5498,7 +5498,7 @@ command_substitute (string, quoted)
/* wait_for gives the terminal back to shell_pgrp. If some other
process group should have it, give it away to that group here.
pipeline_pgrp is non-zero only while we are constructing a
pipline, so what we are concerned about is whether or not that
pipeline, so what we are concerned about is whether or not that
pipeline was started in the background. A pipeline started in
the background should never get the tty back here. */
if (interactive && pipeline_pgrp != (pid_t)0 && (subshell_environment & SUBSHELL_ASYNC) == 0)
@@ -6366,7 +6366,7 @@ get_var_and_type (varname, value, ind, quoted, flags, varp, valp)
{ /* [ */
if (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']')
{
/* Callers have to differentiate betwen indexed and associative */
/* Callers have to differentiate between indexed and associative */
vtype = VT_ARRAYVAR;
if (temp[0] == '*')
vtype |= VT_STARSUB;
@@ -8146,7 +8146,7 @@ expand_word_internal (word, quoted, isexp, contains_dollar_at, expanded_somethin
{
c = string[sindex];
/* Case on toplevel character. */
/* Case on top-level character. */
switch (c)
{
case '\0':
+1 -1
View File
@@ -85,7 +85,7 @@ initialize_signames ()
/* POSIX 1003.1b-1993 real time signals, but take care of incomplete
implementations. Acoording to the standard, both, SIGRTMIN and
SIGRTMAX must be defined, SIGRTMIN must be stricly less than
SIGRTMAX must be defined, SIGRTMIN must be strictly less than
SIGRTMAX, and the difference must be at least 7, that is, there
must be at least eight distinct real time signals. */
+1 -1
View File
@@ -157,7 +157,7 @@ integer_expected_error (pch)
}
/* Increment our position in the argument list. Check that we're not
past the end of the argument list. This check is supressed if the
past the end of the argument list. This check is suppressed if the
argument is FALSE. Made a macro for efficiency. */
#define advance(f) do { ++pos; if (f && pos >= argc) beyond (); } while (0)
#define unary_advance() do { advance (1); ++pos; } while (0)
+2 -2
View File
@@ -100,7 +100,7 @@ extern WORD_LIST *subst_assign_varlist;
SigHandler *original_signals[NSIG];
/* For each signal, a slot for a string, which is a command to be
executed when that signal is recieved. The slot can also contain
executed when that signal is received. The slot can also contain
DEFAULT_SIG, which means do whatever you were going to do before
you were so rudely interrupted, or IGNORE_SIG, which says ignore
this signal. */
@@ -242,7 +242,7 @@ decode_signal (string, flags)
if (name == 0 || name[0] == '\0')
continue;
/* Check name without the SIG prefix first case sensitivly or
/* Check name without the SIG prefix first case sensitively or
insensitively depending on whether flags includes DSIG_NOCASE */
if (STREQN (name, "SIG", 3))
{
+1 -1
View File
@@ -46,7 +46,7 @@
#define BASH_NSIG NSIG+3
/* Flags values for decode_signal() */
#define DSIG_SIGPREFIX 0x01 /* don't alllow `SIG' PREFIX */
#define DSIG_SIGPREFIX 0x01 /* don't allow `SIG' PREFIX */
#define DSIG_NOCASE 0x02 /* case-insensitive comparison */
/* A value which can never be the target of a trap handler. */
+2 -2
View File
@@ -1158,7 +1158,7 @@ get_self (self)
}
#if defined (ARRAY_VARS)
/* A generic dynamic array variable initializer. Intialize array variable
/* A generic dynamic array variable initializer. Initialize array variable
NAME with dynamic value function GETFUNC and assignment function SETFUNC. */
static SHELL_VAR *
init_dynamic_array_var (name, getfunc, setfunc, attrs)
@@ -2299,7 +2299,7 @@ new_shell_variable (name)
entry->attributes = 0;
/* Always assume variables are to be made at toplevel!
make_local_variable has the responsibilty of changing the
make_local_variable has the responsibility of changing the
variable context. */
entry->context = 0;