From: Chet Ramey Date: Wed, 20 Jun 2018 15:52:56 +0000 (-0400) Subject: commit bash-20180615 snapshot X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d58f7f88edf029b35e9a74c21aeb0b503d72145b;p=thirdparty%2Fbash.git commit bash-20180615 snapshot --- diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index ae08d6559..ec7ef43fe 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -15526,3 +15526,13 @@ lib/readline/histfile.c - read_history_range: don't apply the heuristic and try to append a history line to an existing history entry if we don't have any history entries. Bug and fix from Edward Huff + + 6/12 + ---- +bashline.c + - attempt_shell_completion: don't all the programmable completion for + INITIALWORD if programmable completion is disabled + - attempt_shell_completion: make sure in_command_position remains set + for an empty command word on an otherwise blank line, making the + presence of assignment statements optional. Report from + Luca Boccassi diff --git a/bashline.c b/bashline.c index bfde491a3..2b080197e 100644 --- a/bashline.c +++ b/bashline.c @@ -1592,8 +1592,8 @@ attempt_shell_completion (text, start, end) } else if (s >= e && n[0] == '\0' && text[0] == '\0' && start > 0) { - foundcs = 0; /* empty command name following assignments */ - in_command_position = was_assignment; + foundcs = 0; /* empty command name following optional assignments */ + in_command_position += was_assignment; } else if (s == start && e == end && STREQ (n, text) && start > 0) { @@ -1605,7 +1605,7 @@ attempt_shell_completion (text, start, end) /* If we have defined a compspec for the initial (command) word, call it and process the results like any other programmable completion. */ - if (in_command_position && foundcs == 0 && iw_compspec) + if (in_command_position && have_progcomps && foundcs == 0 && iw_compspec) prog_complete_matches = programmable_completions (INITIALWORD, text, s, e, &foundcs); FREE (n); diff --git a/config.h.in b/config.h.in index 1e4b71d1e..4c0f4913a 100644 --- a/config.h.in +++ b/config.h.in @@ -1167,6 +1167,9 @@ /* Define if you have a working `mmap' system call. */ #undef HAVE_MMAP +/* Define if you have the `mremap' function. */ +#undef HAVE_MREMAP + /* Define if you have the `munmap' function. */ #undef HAVE_MUNMAP diff --git a/configure b/configure index 091955084..b20c58505 100755 --- a/configure +++ b/configure @@ -11046,7 +11046,7 @@ fi rm -f conftest.mmap conftest.txt for ac_func in __argz_count __argz_next __argz_stringify dcgettext mempcpy \ - munmap stpcpy strcspn + munmap mremap stpcpy strcspn do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/configure.ac b/configure.ac index 6df38e947..5c0e76616 100644 --- a/configure.ac +++ b/configure.ac @@ -850,7 +850,7 @@ AC_CHECK_HEADERS([argz.h errno.h fcntl.h malloc.h stdio_ext.h]) dnl AC_FUNC_MALLOC AC_FUNC_MMAP AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify dcgettext mempcpy \ - munmap stpcpy strcspn]) + munmap mremap stpcpy strcspn]) INTL_DEP= INTL_INC= LIBINTL_H= if test "x$USE_INCLUDED_LIBINTL" = "xyes"; then diff --git a/doc/bash.html b/doc/bash.html index 668b0a3fc..3c4a77407 100644 --- a/doc/bash.html +++ b/doc/bash.html @@ -13975,6 +13975,6 @@ There may be only one active coprocess at a time.
This document was created by man2html from bash.1.
-Time: 08 June 2018 16:16:11 EDT +Time: 12 June 2018 15:50:58 EDT diff --git a/doc/bash.pdf b/doc/bash.pdf index 51c09c1e5..f935be00f 100644 Binary files a/doc/bash.pdf and b/doc/bash.pdf differ diff --git a/doc/bash.ps b/doc/bash.ps index aa5b3a28a..6046a56a0 100644 --- a/doc/bash.ps +++ b/doc/bash.ps @@ -1,6 +1,6 @@ %!PS-Adobe-3.0 %%Creator: groff version 1.22.3 -%%CreationDate: Fri Jun 8 16:15:59 2018 +%%CreationDate: Tue Jun 12 15:50:57 2018 %%DocumentNeededResources: font Times-Roman %%+ font Times-Bold %%+ font Times-Italic diff --git a/doc/builtins.ps b/doc/builtins.ps index c2093d7c6..a41975990 100644 --- a/doc/builtins.ps +++ b/doc/builtins.ps @@ -1,6 +1,6 @@ %!PS-Adobe-3.0 %%Creator: groff version 1.22.3 -%%CreationDate: Fri Jun 8 16:15:59 2018 +%%CreationDate: Tue Jun 12 15:50:57 2018 %%DocumentNeededResources: font Times-Roman %%+ font Times-Bold %%+ font Times-Italic diff --git a/doc/rbash.ps b/doc/rbash.ps index b7e51a759..73c4d59a1 100644 --- a/doc/rbash.ps +++ b/doc/rbash.ps @@ -1,6 +1,6 @@ %!PS-Adobe-3.0 %%Creator: groff version 1.22.3 -%%CreationDate: Fri Jun 8 16:16:00 2018 +%%CreationDate: Tue Jun 12 15:50:57 2018 %%DocumentNeededResources: font Times-Roman %%+ font Times-Bold %%DocumentSuppliedResources: procset grops 1.22 3 diff --git a/lib/malloc/malloc.c b/lib/malloc/malloc.c index 88d777e5a..32cb0dadb 100644 --- a/lib/malloc/malloc.c +++ b/lib/malloc/malloc.c @@ -111,6 +111,7 @@ # define NO_VALLOC #endif +/* SIZEOF_LONG * 4 - 2, usable bins from 1..NBUCKETS-1 */ #define NBUCKETS 30 #define ISALLOC ((char) 0xf7) /* magic byte that implies allocation */ @@ -195,6 +196,8 @@ typedef union _malloc_guard { #define LESSCORE_MIN 10 #define LESSCORE_FRC 13 +#define MMAP_THRESHOLD 15 /* must be greater than SPLIT_MAX, COMBINE_MAX */ + #define STARTBUCK 1 /* Flags for the internal functions. */ @@ -1053,12 +1056,9 @@ internal_realloc (mem, n, file, line, flags) /* If ok, use the same block, just marking its size as changed. */ if (RIGHT_BUCKET(nbytes, nunits) || RIGHT_BUCKET(nbytes, nunits-1)) { -#if 0 - m = (char *)mem + p->mh_nbytes; -#else /* Compensate for increment above. */ m -= 4; -#endif + *m++ = 0; *m++ = 0; *m++ = 0; *m++ = 0; m = (char *)mem + (p->mh_nbytes = n); @@ -1120,11 +1120,7 @@ internal_memalign (alignment, size, file, line, flags) if (((long) ptr & (alignment - 1)) == 0) return ptr; /* Otherwise, get address of byte in the block that has that alignment. */ -#if 0 - aligned = (char *) (((long) ptr + alignment - 1) & -alignment); -#else aligned = (char *) (((long) ptr + alignment - 1) & (~alignment + 1)); -#endif /* Store a suitable indication of how to free the block, so that free can find the true beginning of it. */ diff --git a/lib/malloc/stats.c b/lib/malloc/stats.c index ae555a1da..4a18a1284 100644 --- a/lib/malloc/stats.c +++ b/lib/malloc/stats.c @@ -104,7 +104,7 @@ _print_malloc_stats (s, fp) { v = malloc_bucket_stats (i); if (v.nmal > 0) - fprintf (fp, "%8lu\t%4d\t%6d\t%5d\t%8d\t%d %5d %8d\n", (unsigned long)v.blocksize, v.nfree, v.nused, v.nmal, v.nmorecore, v.nlesscore, v.nsplit, v.ncoalesce); + fprintf (fp, "%8lu\t%4d\t%6d\t%5d\t%8d\t%8d %5d %8d\n", (unsigned long)v.blocksize, v.nfree, v.nused, v.nmal, v.nmorecore, v.nlesscore, v.nsplit, v.ncoalesce); totfree += v.nfree * v.blocksize; totused += v.nused * v.blocksize; } diff --git a/shell.c b/shell.c index ad76636cd..96cdbe946 100644 --- a/shell.c +++ b/shell.c @@ -1012,7 +1012,7 @@ sh_exit (s) int s; { #if defined (MALLOC_DEBUG) && defined (USING_BASH_MALLOC) - if (malloc_trace_at_exit) + if (malloc_trace_at_exit && (subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PROCSUB)) == 0) trace_malloc_stats (get_name_for_error (), (char *)NULL); /* mlocation_write_table (); */ #endif