mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-07 20:30:52 +02:00
commit bash-20060215 snapshot
This commit is contained in:
+27
-10
@@ -1662,10 +1662,11 @@ rl_on_new_line_with_prompt ()
|
||||
int
|
||||
rl_forced_update_display ()
|
||||
{
|
||||
register char *temp;
|
||||
|
||||
if (visible_line)
|
||||
{
|
||||
register char *temp = visible_line;
|
||||
|
||||
temp = visible_line;
|
||||
while (*temp)
|
||||
*temp++ = '\0';
|
||||
}
|
||||
@@ -1997,20 +1998,36 @@ _rl_make_prompt_for_search (pchar)
|
||||
int pchar;
|
||||
{
|
||||
int len;
|
||||
char *pmt;
|
||||
char *pmt, *p;
|
||||
|
||||
rl_save_prompt ();
|
||||
|
||||
len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
|
||||
pmt = (char *)xmalloc (len + 2);
|
||||
if (len)
|
||||
strcpy (pmt, rl_prompt);
|
||||
pmt[len] = pchar;
|
||||
pmt[len+1] = '\0';
|
||||
/* We've saved the prompt, and can do anything with the various prompt
|
||||
strings we need before they're restored. We want the unexpanded
|
||||
portion of the prompt string after any final newline. */
|
||||
p = rl_prompt ? strrchr (rl_prompt, '\n') : 0;
|
||||
if (p == 0)
|
||||
{
|
||||
len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
|
||||
pmt = (char *)xmalloc (len + 2);
|
||||
if (len)
|
||||
strcpy (pmt, rl_prompt);
|
||||
pmt[len] = pchar;
|
||||
pmt[len+1] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
p++;
|
||||
len = strlen (p);
|
||||
pmt = (char *)xmalloc (len + 2);
|
||||
if (len)
|
||||
strcpy (pmt, p);
|
||||
pmt[len] = pchar;
|
||||
pmt[len+1] = '\0';
|
||||
}
|
||||
|
||||
/* will be overwritten by expand_prompt, called from rl_message */
|
||||
prompt_physical_chars = saved_physical_chars + 1;
|
||||
|
||||
return pmt;
|
||||
}
|
||||
|
||||
|
||||
+3
-11
@@ -1390,15 +1390,6 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
}
|
||||
}
|
||||
|
||||
if (*old == 0 && *new != 0)
|
||||
{
|
||||
fprintf (stderr, "old == 0x%x new = 0x%x\r\n", old, new);
|
||||
fprintf (stderr, "omax == %d nmax = %d\r\n", omax, nmax);
|
||||
fprintf (stderr, "ne == 0x%x nfd = 0x%x\r\n", ne, nfd);
|
||||
fprintf (stderr, "oe == 0x%x ofd = 0x%x\r\n", oe, ofd);
|
||||
fprintf (stderr, "ols == 0x%x nls = 0x%x\r\n", ols, nls);
|
||||
}
|
||||
|
||||
/* count of invisible characters in the current invisible line. */
|
||||
current_invis_chars = W_OFFSET (current_line, wrap_offset);
|
||||
if (_rl_last_v_pos != current_line)
|
||||
@@ -1671,10 +1662,11 @@ rl_on_new_line_with_prompt ()
|
||||
int
|
||||
rl_forced_update_display ()
|
||||
{
|
||||
register char *temp;
|
||||
|
||||
if (visible_line)
|
||||
{
|
||||
register char *temp = visible_line;
|
||||
|
||||
temp = visible_line;
|
||||
while (*temp)
|
||||
*temp++ = '\0';
|
||||
}
|
||||
|
||||
@@ -282,6 +282,7 @@ rl_set_prompt (prompt)
|
||||
{
|
||||
FREE (rl_prompt);
|
||||
rl_prompt = prompt ? savestring (prompt) : (char *)NULL;
|
||||
rl_display_prompt = rl_prompt ? rl_prompt : "";
|
||||
|
||||
rl_visible_prompt_length = rl_expand_prompt (rl_prompt);
|
||||
return 0;
|
||||
|
||||
@@ -1095,7 +1095,7 @@ bind_arrow_keys_internal (map)
|
||||
rl_bind_keyseq_if_unbound ("\033OH", rl_beg_of_line);
|
||||
rl_bind_keyseq_if_unbound ("\033OF", rl_end_of_line);
|
||||
|
||||
#if 1 /* was defined (__MINGW32__)*/
|
||||
#if defined (__MINGW32__)
|
||||
rl_bind_keyseq_if_unbound ("\340H", rl_get_previous_history);
|
||||
rl_bind_keyseq_if_unbound ("\340P", rl_get_next_history);
|
||||
rl_bind_keyseq_if_unbound ("\340M", rl_forward_char);
|
||||
|
||||
Reference in New Issue
Block a user