summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2006-03-27 23:53:05 +0000
committerache <ache@FreeBSD.org>2006-03-27 23:53:05 +0000
commit593cd30b45b4a08a2e0938c2eeccfeff0b87c94e (patch)
tree76ebd456ed0476a1d4e9dbe5da2ad31e9b823df7 /contrib
parent255936645ee180cbe2421e975b37ca5a0b909f0d (diff)
downloadFreeBSD-src-593cd30b45b4a08a2e0938c2eeccfeff0b87c94e.zip
FreeBSD-src-593cd30b45b4a08a2e0938c2eeccfeff0b87c94e.tar.gz
Merge conflicts after official patches
Diffstat (limited to 'contrib')
-rw-r--r--contrib/libreadline/display.c20
-rw-r--r--contrib/libreadline/terminal.c5
2 files changed, 15 insertions, 10 deletions
diff --git a/contrib/libreadline/display.c b/contrib/libreadline/display.c
index 88fb508..856b9e1 100644
--- a/contrib/libreadline/display.c
+++ b/contrib/libreadline/display.c
@@ -1984,11 +1984,15 @@ _rl_make_prompt_for_search (pchar)
int pchar;
{
int len;
- char *pmt;
+ char *pmt, *p;
rl_save_prompt ();
- if (saved_local_prompt == 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);
@@ -1999,19 +2003,17 @@ _rl_make_prompt_for_search (pchar)
}
else
{
- len = *saved_local_prompt ? strlen (saved_local_prompt) : 0;
+ p++;
+ len = strlen (p);
pmt = (char *)xmalloc (len + 2);
if (len)
- strcpy (pmt, saved_local_prompt);
+ strcpy (pmt, p);
pmt[len] = pchar;
pmt[len+1] = '\0';
- local_prompt = savestring (pmt);
- prompt_last_invisible = saved_last_invisible;
- prompt_visible_length = saved_visible_length + 1;
- }
+ }
+ /* will be overwritten by expand_prompt, called from rl_message */
prompt_physical_chars = saved_physical_chars + 1;
-
return pmt;
}
diff --git a/contrib/libreadline/terminal.c b/contrib/libreadline/terminal.c
index e2cb8dc..ef7d35b 100644
--- a/contrib/libreadline/terminal.c
+++ b/contrib/libreadline/terminal.c
@@ -123,7 +123,7 @@ char *_rl_term_up;
static char *_rl_visible_bell;
/* Non-zero means the terminal can auto-wrap lines. */
-int _rl_term_autowrap;
+int _rl_term_autowrap = -1;
/* Non-zero means that this terminal has a meta key. */
static int term_has_meta;
@@ -275,6 +275,9 @@ void
_rl_set_screen_size (rows, cols)
int rows, cols;
{
+ if (_rl_term_autowrap == -1)
+ _rl_init_terminal_io (rl_terminal_name);
+
if (rows > 0)
_rl_screenheight = rows;
if (cols > 0)
OpenPOWER on IntegriCloud