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>.
- 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>
/* 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 = "";
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
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)
/* 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 = "";
visible_wrap_offset = wrap_offset;
}
+ RL_UNSETSTATE (RL_STATE_REDISPLAYING);
_rl_release_sigint ();
}
#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))
_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 ();
}
}
}
/* 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);
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
}
/* 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);
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. */
-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