]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20200410 snapshot
authorChet Ramey <chet.ramey@case.edu>
Mon, 13 Apr 2020 14:31:06 +0000 (10:31 -0400)
committerChet Ramey <chet.ramey@case.edu>
Mon, 13 Apr 2020 14:31:06 +0000 (10:31 -0400)
CWRU/CWRU.chlog
lib/readline/display.c
lib/readline/text.c
sig.c
tests/RUN-ONE-TEST

index 025eeb2b7dc1f4f8748f27074853808ee2d8adef..ba2fdbe1dbace2ca309382a87aeaed2678247b18 100644 (file)
@@ -7948,3 +7948,31 @@ builtins/wait.def
          the JWAIT_WAITING flag, and clean up by calling unset_waitlist().
          From a suggestion from Robert Elz <kre@munnari.oz.au> back in 3/2019
          (originally in 10/2017)
+
+                                  4/11
+                                  ----
+lib/readline/display.c
+       - update_line: in step 5b of the line wrapping prompt code, make sure
+         OFDF and NFDF are set before performing a dumb update
+
+                                  4/12
+                                  ----
+sig.c
+       - termsig_handler: make sure to restore TOP_LEVEL_SIGMASK before
+         resending a terminating signal to ourselves, in the event that this
+         is called in a signal handler context with the terminating signal
+         blocked. Inspired by a report from <gentoo_eshoes@tutanota.com>
+
+                                  4/13
+                                  ----
+
+lib/readline/text.c
+       - rl_newline: if the region is active, call rl_redisplay to clear
+         standout mode before returning
+
+lib/readline/display.c
+       - norm_face: new function to mark a portion of the invisible face
+         buffer as normal text (no standout)
+       - rl_redisplay: if the line consumes more than a screen's worth of
+         lines, mark the lines that are off the top of the display as having
+         a `normal' face
index 14af1e9210a968037df5e4bbfe861fa559026ac2..491b7d417983f2b8bdc6ddcf3377faceb19e5610 100644 (file)
@@ -65,6 +65,7 @@ extern char *strchr (), *strrchr ();
 
 static void putc_face PARAMS((int, int, char *));
 static void puts_face PARAMS((const char *, const char *, int));
+static void norm_face PARAMS((char *, int));
 
 static void update_line PARAMS((char *, char *, char *, char *, int, int, int, int));
 static void space_to_eol PARAMS((int));
@@ -1246,6 +1247,21 @@ rl_redisplay (void)
                        _rl_last_c_pos > wrap_offset && \
                        o_cpos < prompt_last_invisible)
 
+
+         /* We don't want to highlight anything that's going to be off the top
+            of the display; if the current line takes up more than an entire
+           screen, just mark the lines that won't be displayed as having a
+           `normal' face.
+           It's imperfect, but better than display corruption. */
+         if (rl_mark_active_p () && inv_botlin > _rl_screenheight)
+           {
+             int extra;
+
+             extra = inv_botlin - _rl_screenheight;
+             for (linenum = 0; linenum <= extra; linenum++)
+               norm_face (INV_LINE_FACE(linenum), INV_LLEN (linenum));
+           }
+
          /* For each line in the buffer, do the updating display. */
          for (linenum = 0; linenum <= inv_botlin; linenum++)
            {
@@ -1586,6 +1602,12 @@ puts_face (const char *str, const char *face, int n)
   putc_face (EOF, FACE_NORMAL, &cur_face);
 }
 
+static void
+norm_face (char *face, int n)
+{
+  memset (face, FACE_NORMAL, n);
+}
+
 #define ADJUST_CPOS(x) do { _rl_last_c_pos -= (x) ; cpos_adjusted = 1; } while (0)
 
 /* PWP: update_line() is based on finding the middle difference of each
@@ -1758,6 +1780,9 @@ update_line (char *old, char *old_face, char *new, char *new_face, int current_l
                  ne = new + nmax;
                  nd = newbytes;
                  nfd = new + nd;
+                 ofdf = old_face + oldbytes;
+                 nfdf = new_face + newbytes;
+
                  goto dumb_update;
                }
              if (oldbytes != 0 && newbytes != 0)
index 15f5ebbee358d116742620138993671eb40fbb1f..2567dea268ae2412dda65d9c9fbd898e1ac11e86 100644 (file)
@@ -1095,10 +1095,8 @@ rl_newline (int count, int key)
   if (rl_mark_active_p ())
     {
       rl_deactivate_mark ();
-#if 0  /* Not yet */
       (*rl_redisplay_function) ();
       _rl_want_redisplay = 0;
-#endif
     }
 
   rl_done = 1;
diff --git a/sig.c b/sig.c
index 54bf7d76df3efc37c6da46c6cecd30c71976ed5d..85f791b85906f887a7efeda057c4ad485add8975 100644 (file)
--- a/sig.c
+++ b/sig.c
@@ -608,7 +608,11 @@ termsig_handler (sig)
 
   /* We don't change the set of blocked signals. If a user starts the shell
      with a terminating signal blocked, we won't get here (and if by some
-     magic chance we do, we'll exit below). */
+     magic chance we do, we'll exit below). What we do is to restore the
+     top-level signal mask, in case this is called from a terminating signal
+     handler context, in which case the signal is blocked. */
+  restore_sigmask ();
+
   set_signal_handler (sig, SIG_DFL);
 
   kill (getpid (), sig);
index c8bef8dd12533217b1b65fc20d00f3d1cc1b81e7..0b06381072414283266cf5d055a42ac14b9b6da6 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