commit bash-20080110 snapshot

This commit is contained in:
Chet Ramey
2011-12-07 09:17:25 -05:00
parent b246176e88
commit c2a47ea936
29 changed files with 9736 additions and 8615 deletions
+8 -3
View File
@@ -82,6 +82,7 @@ struct line_state
static struct line_state line_state_array[2];
static struct line_state *line_state_visible = &line_state_array[0];
static struct line_state *line_state_invisible = &line_state_array[1];
static int line_structures_initialized = 0;
/* Backwards-compatible names. */
#define inv_lbreaks (line_state_invisible->lbreaks)
@@ -471,8 +472,7 @@ init_line_structures (minsize)
{
/* should be enough. */
inv_lbsize = vis_lbsize = 256;
inv_lbreaks = (int *)xmalloc (inv_lbsize * sizeof (int));
vis_lbreaks = (int *)xmalloc (vis_lbsize * sizeof (int));
#if defined (HANDLE_MULTIBYTE)
line_state_visible->wbsize = vis_lbsize;
line_state_visible->wrapped_line = (int *)xmalloc (line_state_visible->wbsize * sizeof (int));
@@ -480,8 +480,13 @@ init_line_structures (minsize)
line_state_invisible->wbsize = inv_lbsize;
line_state_invisible->wrapped_line = (int *)xmalloc (line_state_invisible->wbsize * sizeof (int));
#endif
inv_lbreaks = (int *)xmalloc (inv_lbsize * sizeof (int));
vis_lbreaks = (int *)xmalloc (vis_lbsize * sizeof (int));
inv_lbreaks[0] = vis_lbreaks[0] = 0;
}
line_structures_initialized = 1;
}
/* Basic redisplay algorithm. */
@@ -507,7 +512,7 @@ rl_redisplay ()
if (!rl_display_prompt)
rl_display_prompt = "";
if (invisible_line == 0 || vis_lbreaks == 0)
if (line_structures_initialized == 0)
{
init_line_structures (0);
rl_on_new_line ();
+11 -7
View File
@@ -82,6 +82,7 @@ struct line_state
static struct line_state line_state_array[2];
static struct line_state *line_state_visible = &line_state_array[0];
static struct line_state *line_state_invisible = &line_state_array[1];
static int line_structures_initialized = 0;
/* Backwards-compatible names. */
#define inv_lbreaks (line_state_invisible->lbreaks)
@@ -471,8 +472,7 @@ init_line_structures (minsize)
{
/* should be enough. */
inv_lbsize = vis_lbsize = 256;
inv_lbreaks = (int *)xmalloc (inv_lbsize * sizeof (int));
vis_lbreaks = (int *)xmalloc (vis_lbsize * sizeof (int));
#if defined (HANDLE_MULTIBYTE)
line_state_visible->wbsize = vis_lbsize;
line_state_visible->wrapped_line = (int *)xmalloc (line_state_visible->wbsize * sizeof (int));
@@ -480,8 +480,13 @@ init_line_structures (minsize)
line_state_invisible->wbsize = inv_lbsize;
line_state_invisible->wrapped_line = (int *)xmalloc (line_state_invisible->wbsize * sizeof (int));
#endif
inv_lbreaks = (int *)xmalloc (inv_lbsize * sizeof (int));
vis_lbreaks = (int *)xmalloc (vis_lbsize * sizeof (int));
inv_lbreaks[0] = vis_lbreaks[0] = 0;
}
line_structures_initialized = 1;
}
/* Basic redisplay algorithm. */
@@ -507,7 +512,7 @@ rl_redisplay ()
if (!rl_display_prompt)
rl_display_prompt = "";
if (invisible_line == 0 || vis_lbreaks == 0)
if (line_structures_initialized == 0)
{
init_line_structures (0);
rl_on_new_line ();
@@ -651,6 +656,7 @@ rl_redisplay ()
#endif
#if defined (HANDLE_MULTIBYTE)
if (line_state_invisible
memset (line_state_invisible->wrapped_line, 0, line_state_invisible->wbsize * sizeof (int));
num = 0;
#endif
@@ -938,8 +944,9 @@ rl_redisplay ()
second and subsequent lines start at inv_lbreaks[N], offset by
OFFSET (which has already been calculated above). */
#define INVIS_FIRST() (prompt_physical_chars > _rl_screenwidth ? prompt_invis_chars_first_line : wrap_offset)
#define WRAP_OFFSET(line, offset) ((line == 0) \
? (offset ? prompt_invis_chars_first_line : 0) \
? (offset ? INVIS_FIRST() : 0) \
: ((line == prompt_last_screen_line) ? wrap_offset-prompt_invis_chars_first_line : 0))
#define W_OFFSET(line, offset) ((line) == 0 ? offset : 0)
#define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l]))
@@ -1618,9 +1625,6 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
}
else
{
/* We have horizontal scrolling and we are not inserting at
the end. We have invisible characters in this line. This
is a dumb update. */
_rl_output_some_chars (nfd, temp);
_rl_last_c_pos += col_temp;
/* If nfd begins before any invisible characters in the prompt,