]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20090413 snapshot
authorChet Ramey <chet.ramey@case.edu>
Fri, 9 Dec 2011 01:07:56 +0000 (20:07 -0500)
committerChet Ramey <chet.ramey@case.edu>
Fri, 9 Dec 2011 01:07:56 +0000 (20:07 -0500)
CWRU/CWRU.chlog
CWRU/CWRU.chlog~
lib/readline/display.c
lib/readline/display.c~
lib/readline/readline.h
lib/readline/terminal.c
parse.y
parse.y~
tests/RUN-ONE-TEST

index aa65b8de7ecbbc4294add9cb9742f3236400fd72..6e710684e8cfc1b03814c2249a50b3c07b25c9ea 100644 (file)
@@ -7912,3 +7912,25 @@ lib/readline/rlprivate.h
 lib/readline/display.c
        - block SIGWINCH during redisplay like SIGINT.  Should fix bug reported
          by Nicolai Lissner <nlissne@linux01.org>
+
+                                  4/13
+                                  ----
+lib/readline/readline.h
+       - new readline state variable: RL_STATE_REDISPLAYING
+
+lib/readline/display.c
+       - in rl_redisplay, don't block SIGWINCH during redisplay; just set
+         the REDISPLAYING state
+
+lib/readline/terminal.c
+       - in rl_resize_terminal, don't call rl_redisplay_after_sigwinch() if
+         we're already in the middle of redisplay (RL_STATE_REDISPLAYING).
+         Fix for bug reported by Nicolai Lissner <nlissne@linux01.org>
+
+                                  4/15
+                                  ----
+parse.y
+       - fix parse_comsub to add check for \n when seeing whether the current
+         character can change to a state where a reserved word is legal,
+         since it is not a shell meta character.  Fixes bug reported by
+         Bernd Eggink <monoped@sudrala.de>.
index 760d0d1f473305cad7adc2c63e27b77e5959a841..c7950e41a1ce791db0795bd13322266bf4fdc849 100644 (file)
@@ -7910,4 +7910,19 @@ lib/readline/rlprivate.h
        - new extern declarations for _rl_block_sigwinch and _rl_release_sigwinch
 
 lib/readline/display.c
-       - block SIGWINCH during redisplay like SIGINT
+       - block SIGWINCH during redisplay like SIGINT.  Should fix bug reported
+         by Nicolai Lissner <nlissne@linux01.org>
+
+                                  4/13
+                                  ----
+lib/readline/readline.h
+       - new readline state variable: RL_STATE_REDISPLAYING
+
+lib/readline/display.c
+       - in rl_redisplay, don't block SIGWINCH during redisplay; just set
+         the REDISPLAYING state
+
+lib/readline/terminal.c
+       - in rl_resize_terminal, don't call rl_redisplay_after_sigwinch() if
+         we're already in the middle of redisplay (RL_STATE_REDISPLAYING).
+         Fix for bug reported by Nicolai Lissner <nlissne@linux01.org>
index 7a62fc38c8564bfd2ee715a1ad4041262aa95e69..9ac420a22fac8f40d9f5ea0c7b6a4fb6dc439a5e 100644 (file)
@@ -512,7 +512,7 @@ rl_redisplay ()
   /* Block keyboard interrupts because this function manipulates global
      data structures. */
   _rl_block_sigint ();  
-  _rl_block_sigwinch ();
+  RL_SETSTATE (RL_STATE_REDISPLAYING);
 
   if (!rl_display_prompt)
     rl_display_prompt = "";
@@ -1237,8 +1237,8 @@ rl_redisplay ()
       visible_wrap_offset = wrap_offset;
   }
 
+  RL_UNSETSTATE (RL_STATE_REDISPLAYING);
   _rl_release_sigint ();
-  _rl_release_sigwinch ();
 }
 
 /* PWP: update_line() is based on finding the middle difference of each
@@ -1774,7 +1774,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
             space_to_eol will insert too many spaces.  XXX - maybe we should
             adjust col_lendiff based on the difference between _rl_last_c_pos
             and _rl_screenwidth */
-         if (col_lendiff && (_rl_last_c_pos < _rl_screenwidth))
+         if (col_lendiff && ((MB_CUR_MAX == 1 || rl_byte_oriented) || (_rl_last_c_pos < _rl_screenwidth)))
 #endif
            {     
              if (_rl_term_autowrap && current_line < inv_botlin)
index e941c78ac7a35ab6750f9785454a637ac9e32ab0..39bbb94d6b680061579ffd3819f06845f497e744 100644 (file)
@@ -512,6 +512,7 @@ rl_redisplay ()
   /* Block keyboard interrupts because this function manipulates global
      data structures. */
   _rl_block_sigint ();  
+  RL_SETSTATE (RL_STATE_REDISPLAYING);
 
   if (!rl_display_prompt)
     rl_display_prompt = "";
@@ -1236,6 +1237,7 @@ rl_redisplay ()
       visible_wrap_offset = wrap_offset;
   }
 
+  RL_UNSETSTATE (RL_STATE_REDISPLAYING);
   _rl_release_sigint ();
 }
 
index ba0d5d624588868aef6baebcbf7b3b7e6f02f404..fa02dec0de8ee4c7068079c51f36a9d5711d7883 100644 (file)
@@ -814,8 +814,9 @@ extern int rl_inhibit_completion;
 #define RL_STATE_VIMOTION      0x100000        /* reading vi motion arg */
 #define RL_STATE_MULTIKEY      0x200000        /* reading multiple-key command */
 #define RL_STATE_VICMDONCE     0x400000        /* entered vi command mode at least once */
+#define RL_STATE_REDISPLAYING  0x800000        /* updating terminal display */
 
-#define RL_STATE_DONE          0x800000        /* done; accepted line */
+#define RL_STATE_DONE          0x1000000       /* done; accepted line */
 
 #define RL_SETSTATE(x)         (rl_readline_state |= (x))
 #define RL_UNSETSTATE(x)       (rl_readline_state &= ~(x))
index 87fdf1012e69cd5f72d01fac4e4ccab66ebc8848..768ec9bbdece750c7f2e1978c0ec9630f6f85689 100644 (file)
@@ -355,7 +355,7 @@ rl_resize_terminal ()
       _rl_get_screen_size (fileno (rl_instream), 1);
       if (CUSTOM_REDISPLAY_FUNC ())
        rl_forced_update_display ();
-      else
+      else if (RL_ISSTATE(RL_STATE_REDISPLAYING) == 0)
        _rl_redisplay_after_sigwinch ();
     }
 }
diff --git a/parse.y b/parse.y
index 7148b02ec10cd9b7f968ed8dc87eb45b22da42fc..6e5d65c83620cf276e496d273237c0621b19ff12 100644 (file)
--- a/parse.y
+++ b/parse.y
@@ -3374,7 +3374,7 @@ eof_error:
        }
 
       /* Meta-characters that can introduce a reserved word.  Not perfect yet. */
-      if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && shellmeta(ch))
+      if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n'))
        {
          /* Add this character. */
          RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64);
index 22929b3fbddb9b45605aaa742dbea2efcefc0411..7c1f19fd2d6af10aea041e1d47f448c6c267e8a1 100644 (file)
--- a/parse.y~
+++ b/parse.y~
@@ -1879,7 +1879,7 @@ read_secondary_line (remove_quoted_newline)
     prompt_again ();
   ret = read_a_line (remove_quoted_newline);
 #if defined (HISTORY)
-  if (remember_on_history && (parser_state & PST_HEREDOC))
+  if (ret && remember_on_history && (parser_state & PST_HEREDOC))
     {
       /* To make adding the the here-document body right, we need to rely
         on history_delimiting_chars() returning \n for the first line of
@@ -3374,7 +3374,7 @@ eof_error:
        }
 
       /* Meta-characters that can introduce a reserved word.  Not perfect yet. */
-      if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && shellmeta(ch))
+      if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n'))
        {
          /* Add this character. */
          RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64);
@@ -3505,12 +3505,12 @@ eof_error:
       else if MBTEST(ch == close && (tflags & LEX_INCASE) == 0)                /* ending delimiter */
 {
        count--;
-/*itrace("parse_comsub:%d: found close: count = %d", line_number, count);*/
+itrace("parse_comsub:%d: found close: count = %d", line_number, count);
 }
       else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && (tflags & LEX_INCASE) == 0 && ch == open)        /* nested begin */
 {
        count++;
-/*itrace("parse_comsub:%d: found open: count = %d", line_number, count);*/
+itrace("parse_comsub:%d: found open: count = %d", line_number, count);
 }
 
       /* Add this character. */
index 3efcf32d68e9722024b6ca9d67f9e81b2aa5ac04..72ec06a2c1fd8dde92acea5e8ac773e35f1d061b 100755 (executable)
@@ -1,4 +1,4 @@
-BUILD_DIR=/usr/local/build/chet/bash/bash-current
+BUILD_DIR=/usr/local/build/bash/bash-current
 THIS_SH=$BUILD_DIR/bash
 PATH=$PATH:$BUILD_DIR