]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20180615 snapshot
authorChet Ramey <chet.ramey@case.edu>
Wed, 20 Jun 2018 15:52:56 +0000 (11:52 -0400)
committerChet Ramey <chet.ramey@case.edu>
Wed, 20 Jun 2018 15:52:56 +0000 (11:52 -0400)
13 files changed:
CWRU/CWRU.chlog
bashline.c
config.h.in
configure
configure.ac
doc/bash.html
doc/bash.pdf
doc/bash.ps
doc/builtins.ps
doc/rbash.ps
lib/malloc/malloc.c
lib/malloc/stats.c
shell.c

index ae08d65594a362d28bc40f215bb62803e1b269fb..ec7ef43fe7fbd65efa5edb8a8a9e1b5fb5c44d06 100644 (file)
@@ -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 <ejhuff@gmail.com>
+
+                                  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 <bluca@debian.org>
index bfde491a3864ebff9ee1b13927b88f782c11db4d..2b080197eb476f82ea278ec5f72ffc4b14c8eea3 100644 (file)
@@ -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);
index 1e4b71d1e7fe9a094e5cff92aa986b16ed4560d2..4c0f4913aae319455b65c6379ea55dfd3ff75964 100644 (file)
 /* 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
 
index 091955084cec17e50c308c2abeb601573d370fbd..b20c58505b139a0cc02308fe5c9cceb7dcd1691c 100755 (executable)
--- 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"
index 6df38e947bf626e9214e620332d3a7cf9f7bd479..5c0e76616d99f6cf9d91c448384b71501b48aca7 100644 (file)
@@ -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
index 668b0a3fc220989875ede23cdf01292e760e1a21..3c4a77407331cbf98e5e9238c096565b350f3bab 100644 (file)
@@ -13975,6 +13975,6 @@ There may be only one active coprocess at a time.
 </DL>
 <HR>
 This document was created by man2html from bash.1.<BR>
-Time: 08 June 2018 16:16:11 EDT
+Time: 12 June 2018 15:50:58 EDT
 </BODY>
 </HTML>
index 51c09c1e54cdbf37cf7a8b92aee43f8822fcf7c0..f935be00fad5e1c62e78c7b1abc0cd61f8d779eb 100644 (file)
Binary files a/doc/bash.pdf and b/doc/bash.pdf differ
index aa5b3a28aeaa1d41a78d46dc49510e29ce6e5bec..6046a56a0338a46ba255baeb573f0223a75a6b06 100644 (file)
@@ -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
index c2093d7c6850158c6a1bdc057e32e02d710b15c8..a4197599085485d4eca6874e37904b3a1ac2f260 100644 (file)
@@ -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
index b7e51a75963b1c41bf4c67d3a628b390327d2788..73c4d59a121ccd78a72cd69bdd20d3d168f1b1e6 100644 (file)
@@ -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
index 88d777e5add4c4569f9c08320aaec03ecf34f433..32cb0dadbc4acff2cb664835f9ffc1dc89a92227 100644 (file)
 #  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.  */
index ae555a1da41a0749fb8a3189a08cb00ad20b4d12..4a18a12840da82e207edc66266cad004779882bb 100644 (file)
@@ -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 ad76636cdb74e0ee0256c9cddef2f85cbffcc41e..96cdbe946ed92db4e03c0bafcdc0f475666aad47 100644 (file)
--- 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