]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20040205 snapshot
authorChet Ramey <chet.ramey@case.edu>
Sat, 3 Dec 2011 17:54:32 +0000 (12:54 -0500)
committerChet Ramey <chet.ramey@case.edu>
Sat, 3 Dec 2011 17:54:32 +0000 (12:54 -0500)
12 files changed:
CHANGES
CWRU/CWRU.chlog
aclocal.m4
autom4te.cache/output.0
autom4te.cache/requests
autom4te.cache/traces.0
config.h.in
configure
configure.in
print_cmd.c
subst.c
tests/RUN-ONE-TEST

diff --git a/CHANGES b/CHANGES
index ff9e38df4542f87b875b55713c7a53c21d56ec24..51f588cb6efda37cc865ec7a963990ae33067733 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -57,7 +57,7 @@ q.  Fixed a bug that could cause core dumps when checking whether a quoted
     command name was being completed.
 
 r.  Fixes to the pattern removal and pattern replacement expansions to deal
-    with multibyte characters better.
+    with multibyte characters better (and faster).
 
 s.  Fix to the substring expansion (${param:off[:len]}) to deal with (possibly
     multibyte) characters instead of raw bytes.
@@ -75,6 +75,9 @@ w.  Fixed a bug that caused "$@" to expand incorrectly when used as the right
     hand side of a parameter expansion such as ${word:="$@"} if the first
     character of $IFS was not a space.
 
+x.  Fixed a slight cosmetic problem when printing commands containing a
+    `>&word' redirection.
+
 2.  Changes to Readline
 
 a.  Change to history expansion functions to treat `^' as equivalent to word
index e18e52e5f09f52ba6285733054741e51a2102f54..0bc0bd261c52ac53f3db88ba02345d6e539f2443 100644 (file)
@@ -9162,4 +9162,18 @@ subst.c
          remove_wpattern
        - new function, wcsdup, wide-character version of strdup(3)
 
-       
+                                   2/4
+                                   ---
+print_cmd.c
+       - temporarily translate a >&filename redirection from
+         r_duplicating_output_word to r_err_and_out (as the expansion code
+         in redir.c does) so it prints without a leading `1' (file
+         descriptor)
+
+                                   2/5
+                                   ---
+aclocal.m4
+       - add a check for wcsdup to BASH_CHECK_MULTIBYTE
+
+config.h.in
+       - add HAVE_WCSDUP define
index 12b3b8026151927801bafa35246a6cc110a67f7f..97f5517dd6c5d25798c42459449997f4be81cf6f 100644 (file)
@@ -1677,6 +1677,7 @@ AC_CHECK_FUNC(mbrtowc, AC_DEFINE(HAVE_MBRTOWC))
 AC_CHECK_FUNC(mbrlen, AC_DEFINE(HAVE_MBRLEN))
 AC_CHECK_FUNC(wctomb, AC_DEFINE(HAVE_WCTOMB))
 AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH))
+AC_CHECK_FUNC(wcsdup, AC_DEFINE(HAVE_WCSDUP))
 
 AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t,
 [AC_TRY_COMPILE([
index 6e93c90fd1717887b4a4d9fb0bc1f9b0bcba72d2..fab1f3e561bcf470a9fdc29a2ce4480e801d7d31 100644 (file)
@@ -1,5 +1,5 @@
 @%:@! /bin/sh
-@%:@ From configure.in for Bash 3.0, version 3.161, from autoconf version AC_ACVERSION.
+@%:@ From configure.in for Bash 3.0, version 3.162, from autoconf version AC_ACVERSION.
 @%:@ Guess values for system-dependent variables and create Makefiles.
 @%:@ Generated by GNU Autoconf 2.57 for bash 3.0-beta1.
 @%:@
@@ -14614,6 +14614,85 @@ _ACEOF
 
 fi
 
+echo "$as_me:$LINENO: checking for wcsdup" >&5
+echo $ECHO_N "checking for wcsdup... $ECHO_C" >&6
+if test "${ac_cv_func_wcsdup+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char wcsdup (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char wcsdup ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_wcsdup) || defined (__stub___wcsdup)
+choke me
+#else
+char (*f) () = wcsdup;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != wcsdup;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_wcsdup=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_wcsdup=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_wcsdup" >&5
+echo "${ECHO_T}$ac_cv_func_wcsdup" >&6
+if test $ac_cv_func_wcsdup = yes; then
+  cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_WCSDUP 1
+_ACEOF
+
+fi
+
 
 echo "$as_me:$LINENO: checking for mbstate_t" >&5
 echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
index 355fa7278359edb9d29aa0c3cdd3ca16a6f9b2bc..506bce332ef80133f1ad95a773e2839a085ffc1f 100644 (file)
                         'configure.in'
                       ],
                       {
-                        'AC_TYPE_MODE_T' => 1,
-                        'AC_C_VOLATILE' => 1,
-                        'AC_FUNC_STRNLEN' => 1,
-                        'AM_AUTOMAKE_VERSION' => 1,
-                        'AC_PROG_LIBTOOL' => 1,
-                        'AC_DEFINE_TRACE_LITERAL' => 1,
-                        'AC_STRUCT_TM' => 1,
                         'AC_FUNC_CLOSEDIR_VOID' => 1,
-                        'AC_TYPE_SIZE_T' => 1,
+                        'AC_FUNC_CHOWN' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AC_FUNC_ALLOCA' => 1,
+                        'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
+                        'AC_HEADER_SYS_WAIT' => 1,
                         'AC_PROG_LN_S' => 1,
-                        'AC_PROG_MAKE_SET' => 1,
-                        'AC_FUNC_FSEEKO' => 1,
-                        'AC_LIBSOURCE' => 1,
-                        'AC_C_INLINE' => 1,
-                        'AC_DECL_SYS_SIGLIST' => 1,
-                        'AC_FUNC_OBSTACK' => 1,
                         'AC_CHECK_FUNCS' => 1,
-                        'AC_FUNC_UTIME_NULL' => 1,
-                        'AC_STRUCT_ST_BLOCKS' => 1,
-                        'AC_FUNC_GETLOADAVG' => 1,
-                        'AC_PROG_INSTALL' => 1,
-                        'AM_GNU_GETTEXT' => 1,
-                        'AC_CONFIG_AUX_DIR' => 1,
-                        'AC_HEADER_STDC' => 1,
-                        'AC_PROG_YACC' => 1,
-                        'AC_PROG_RANLIB' => 1,
-                        'AC_CONFIG_HEADERS' => 1,
-                        'AC_FUNC_STRCOLL' => 1,
+                        'AC_HEADER_DIRENT' => 1,
                         'AC_HEADER_TIME' => 1,
-                        'AC_FUNC_WAIT3' => 1,
+                        'AC_CONFIG_AUX_DIR' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'AC_PROG_GCC_TRADITIONAL' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        'AC_TYPE_OFF_T' => 1,
+                        'AC_FUNC_GETGROUPS' => 1,
                         'AC_SUBST' => 1,
-                        'AH_OUTPUT' => 1,
-                        'AC_FUNC_CHOWN' => 1,
-                        'AC_FUNC_LSTAT' => 1,
-                        'AC_PROG_CPP' => 1,
+                        'AC_LIBSOURCE' => 1,
+                        'AC_CANONICAL_HOST' => 1,
                         'AC_PROG_CXX' => 1,
-                        'AC_HEADER_DIRENT' => 1,
-                        'AC_FUNC_ERROR_AT_LINE' => 1,
-                        'AC_FUNC_MBRTOWC' => 1,
-                        'AC_PATH_X' => 1,
+                        'AC_PROG_LIBTOOL' => 1,
+                        'AC_FUNC_OBSTACK' => 1,
                         'AC_FUNC_STAT' => 1,
-                        'm4_pattern_forbid' => 1,
-                        'AC_TYPE_PID_T' => 1,
-                        'AC_PROG_LEX' => 1,
-                        'AC_TYPE_OFF_T' => 1,
-                        'AC_PROG_CC' => 1,
-                        'AC_CANONICAL_SYSTEM' => 1,
-                        'AC_CHECK_LIB' => 1,
-                        'AC_FUNC_SETVBUF_REVERSED' => 1,
-                        'AC_CANONICAL_HOST' => 1,
+                        'AM_GNU_GETTEXT' => 1,
+                        'AC_PROG_AWK' => 1,
+                        'AC_FUNC_MALLOC' => 1,
+                        'AC_FUNC_STRTOD' => 1,
+                        'AC_FUNC_MKTIME' => 1,
+                        'AC_CONFIG_FILES' => 1,
+                        'AC_STRUCT_TIMEZONE' => 1,
+                        'AC_FUNC_FORK' => 1,
+                        'AC_FUNC_STRFTIME' => 1,
+                        'AC_C_VOLATILE' => 1,
+                        'AC_FUNC_GETLOADAVG' => 1,
+                        'AC_TYPE_MODE_T' => 1,
+                        'm4_pattern_allow' => 1,
                         'AC_FUNC_MMAP' => 1,
-                        'AM_CONDITIONAL' => 1,
-                        'AM_PROG_CC_C_O' => 1,
-                        'm4_include' => 1,
+                        'AC_PROG_RANLIB' => 1,
                         'AC_HEADER_MAJOR' => 1,
-                        'AC_FUNC_MKTIME' => 1,
-                        'AC_FUNC_GETPGRP' => 1,
-                        'AC_CHECK_HEADERS' => 1,
-                        'AC_FUNC_STRTOD' => 1,
-                        'AC_FUNC_MALLOC' => 1,
-                        'AC_HEADER_SYS_WAIT' => 1,
-                        'AC_FUNC_SELECT_ARGTYPES' => 1,
-                        'AC_FUNC_VPRINTF' => 1,
-                        'AC_FUNC_STRERROR_R' => 1,
-                        'AC_CHECK_MEMBERS' => 1,
+                        'AC_FUNC_ERROR_AT_LINE' => 1,
+                        'AC_FUNC_FSEEKO' => 1,
+                        'm4_pattern_forbid' => 1,
+                        'AC_PATH_X' => 1,
+                        'AC_TYPE_UID_T' => 1,
+                        'AC_DEFINE_TRACE_LITERAL' => 1,
+                        'AC_PROG_INSTALL' => 1,
                         'AC_INIT' => 1,
+                        'AC_CHECK_LIB' => 1,
+                        'AC_STRUCT_TM' => 1,
+                        'AC_FUNC_SETPGRP' => 1,
+                        'AC_HEADER_STAT' => 1,
+                        'AC_FUNC_STRCOLL' => 1,
+                        'm4_include' => 1,
+                        'AC_STRUCT_ST_BLOCKS' => 1,
                         'AM_MAINTAINER_MODE' => 1,
-                        'AC_C_CONST' => 1,
-                        'AC_FUNC_MEMCMP' => 1,
-                        'AM_INIT_AUTOMAKE' => 1,
-                        'AC_FUNC_ALLOCA' => 1,
-                        'm4_pattern_allow' => 1,
-                        'AC_STRUCT_TIMEZONE' => 1,
-                        'AC_PROG_AWK' => 1,
                         'AC_FUNC_REALLOC' => 1,
-                        'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
                         'include' => 1,
-                        'AC_TYPE_SIGNAL' => 1,
-                        'AC_FUNC_FORK' => 1,
+                        'AC_FUNC_MEMCMP' => 1,
+                        'AC_FUNC_VPRINTF' => 1,
+                        'AC_PROG_CPP' => 1,
+                        'AC_TYPE_PID_T' => 1,
+                        'AC_C_INLINE' => 1,
+                        'AC_FUNC_WAIT3' => 1,
+                        'AC_FUNC_GETPGRP' => 1,
+                        'AC_HEADER_STDC' => 1,
+                        'AC_FUNC_STRNLEN' => 1,
+                        'AC_FUNC_MBRTOWC' => 1,
+                        'AC_C_CONST' => 1,
+                        'AC_FUNC_SELECT_ARGTYPES' => 1,
+                        'AM_PROG_CC_C_O' => 1,
                         'AC_CONFIG_SUBDIRS' => 1,
-                        'AC_PROG_GCC_TRADITIONAL' => 1,
-                        'AC_CONFIG_FILES' => 1,
-                        'AC_FUNC_GETGROUPS' => 1,
+                        'AC_CHECK_MEMBERS' => 1,
+                        'AC_FUNC_STRERROR_R' => 1,
+                        'AC_CHECK_HEADERS' => 1,
                         'AC_CHECK_TYPES' => 1,
-                        'AC_FUNC_SETPGRP' => 1,
+                        'AC_FUNC_GETMNTENT' => 1,
                         'AC_REPLACE_FNMATCH' => 1,
-                        'AC_FUNC_STRFTIME' => 1,
-                        'AC_HEADER_STAT' => 1,
-                        'AC_TYPE_UID_T' => 1,
-                        'AC_FUNC_GETMNTENT' => 1
+                        'AC_FUNC_SETVBUF_REVERSED' => 1,
+                        'AC_CONFIG_HEADERS' => 1,
+                        'AC_PROG_YACC' => 1,
+                        'AC_TYPE_SIGNAL' => 1,
+                        'AC_DECL_SYS_SIGLIST' => 1,
+                        'AC_CANONICAL_SYSTEM' => 1,
+                        'AC_PROG_CC' => 1,
+                        'AC_TYPE_SIZE_T' => 1,
+                        'AC_FUNC_UTIME_NULL' => 1,
+                        'AH_OUTPUT' => 1,
+                        'AC_PROG_LEX' => 1,
+                        'AC_FUNC_LSTAT' => 1,
+                        'AC_PROG_MAKE_SET' => 1
                       }
                     ], 'Request' )
            );
index 79667a4a4bad3e48855c0153e02c72fdd86384b2..1f6797199005d1bc11d6682e44915280606e9db2 100644 (file)
@@ -886,6 +886,7 @@ m4trace:configure.in:696: -2- AC_DEFINE_TRACE_LITERAL([HAVE_MBRTOWC])
 m4trace:configure.in:696: -2- AC_DEFINE_TRACE_LITERAL([HAVE_MBRLEN])
 m4trace:configure.in:696: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WCTOMB])
 m4trace:configure.in:696: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WCWIDTH])
+m4trace:configure.in:696: -2- AC_DEFINE_TRACE_LITERAL([HAVE_WCSDUP])
 m4trace:configure.in:696: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MBSTATE_T])
 m4trace:configure.in:696: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LANGINFO_CODESET])
 m4trace:configure.in:700: -1- AC_CHECK_LIB([dl], [dlopen])
index ad894ec60b5532d3f55356295915dbd95c971da1..0780d09502c546772c43f42387107ad8d6f616ca 100644 (file)
 /* Define if you have the wait3 function.  */
 #undef HAVE_WAIT3
 
+/* Define if you have the wcsdup function.  */
+#undef HAVE_WCSDUP
+
 /* Define if you have the wctomb function.  */
 #undef HAVE_WCTOMB
 
index ae1a94eb0a0ee45d686eefcf74c2a4a17881a58f..6dac156baba9d5559f051b5b29a9ef4f2c154563 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in for Bash 3.0, version 3.161, from autoconf version AC_ACVERSION.
+# From configure.in for Bash 3.0, version 3.162, from autoconf version AC_ACVERSION.
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.57 for bash 3.0-beta1.
 #
@@ -14614,6 +14614,85 @@ _ACEOF
 
 fi
 
+echo "$as_me:$LINENO: checking for wcsdup" >&5
+echo $ECHO_N "checking for wcsdup... $ECHO_C" >&6
+if test "${ac_cv_func_wcsdup+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char wcsdup (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char wcsdup ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_wcsdup) || defined (__stub___wcsdup)
+choke me
+#else
+char (*f) () = wcsdup;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != wcsdup;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_wcsdup=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_wcsdup=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_wcsdup" >&5
+echo "${ECHO_T}$ac_cv_func_wcsdup" >&6
+if test $ac_cv_func_wcsdup = yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_WCSDUP 1
+_ACEOF
+
+fi
+
 
 echo "$as_me:$LINENO: checking for mbstate_t" >&5
 echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
index 7e709b27959e59f6dfa294de8e8cc58a4acbf971..6ba667dbca479a34f8977317cdddf841b4a43776 100644 (file)
@@ -22,7 +22,7 @@ dnl Process this file with autoconf to produce a configure script.
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
 
-AC_REVISION([for Bash 3.0, version 3.161, from autoconf version] AC_ACVERSION)dnl
+AC_REVISION([for Bash 3.0, version 3.162, from autoconf version] AC_ACVERSION)dnl
 
 define(bashvers, 3.0)
 define(relstatus, beta1)
index 631c5ccff3ce5a29b4e341b609ae79358e9f5426..8381bc33717582934f5be0457b72b7a5f243d9e2 100644 (file)
@@ -775,6 +775,13 @@ print_redirection_list (redirects)
          else
            hdtail = heredocs = newredir;
        }
+      else if (redirects->instruction == r_duplicating_output_word && redirects->redirector == 1)
+       {
+         /* Temporarily translate it as the execution code does. */
+         redirects->instruction = r_err_and_out;
+         print_redirection (redirects);
+         redirects->instruction = r_duplicating_output_word;
+       }
       else
        print_redirection (redirects);
 
diff --git a/subst.c b/subst.c
index da6174ead8af04782ce4d40ef3b846a173f8651a..68c6f459e701babf79d13d23f9989f553fc6248c 100644 (file)
--- a/subst.c
+++ b/subst.c
@@ -214,7 +214,9 @@ static unsigned char *mb_getcharlens __P((char *, int));
 
 static char *remove_upattern __P((char *, char *, int));
 #if defined (HANDLE_MULTIBYTE)
+#  if !defined (HAVE_WCSDUP)
 static wchar_t *wcsdup __P((wchar_t *));
+#  endif
 static wchar_t *remove_wpattern __P((wchar_t *, size_t, wchar_t *, int));
 #endif
 static char *remove_pattern __P((char *, char *, int));
@@ -2966,6 +2968,8 @@ remove_upattern (param, pattern, op)
 }
 
 #if defined (HANDLE_MULTIBYTE)
+
+#if !defined (HAVE_WCSDUP)
 static wchar_t *
 wcsdup (ws)
      wchar_t *ws;
@@ -2979,6 +2983,7 @@ wcsdup (ws)
     return ret;
   return (wcscpy (ret, ws));
 }
+#endif /* !HAVE_WCSDUP */
 
 static wchar_t *
 remove_wpattern (wparam, wstrlen, wpattern, op)
index 72ec06a2c1fd8dde92acea5e8ac773e35f1d061b..3efcf32d68e9722024b6ca9d67f9e81b2aa5ac04 100755 (executable)
@@ -1,4 +1,4 @@
-BUILD_DIR=/usr/local/build/bash/bash-current
+BUILD_DIR=/usr/local/build/chet/bash/bash-current
 THIS_SH=$BUILD_DIR/bash
 PATH=$PATH:$BUILD_DIR