mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-07 18:52:35 +02:00
commit bash-20170224 snapshot
This commit is contained in:
@@ -60,7 +60,7 @@ int rl_persistent_signal_handlers = 0;
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Callback Readline Functions */
|
||||
/* Callback Readline Functions */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
|
||||
@@ -991,7 +991,6 @@ print_filename (to_print, full_pathname, prefix_bytes)
|
||||
slen--;
|
||||
else
|
||||
new_full_pathname[slen] = '/';
|
||||
new_full_pathname[slen] = '/';
|
||||
strcpy (new_full_pathname + slen + 1, to_print);
|
||||
|
||||
#if defined (VISIBLE_STATS)
|
||||
|
||||
@@ -307,6 +307,8 @@ prompt_modestr (lenp)
|
||||
|
||||
static int *local_prompt_newlines;
|
||||
|
||||
#define APPROX_DIV(n, d) (((n) < (d)) ? 1 : ((n) / (d)) + 1)
|
||||
|
||||
static char *
|
||||
expand_prompt (pmt, flags, lp, lip, niflp, vlp)
|
||||
char *pmt;
|
||||
@@ -349,7 +351,10 @@ expand_prompt (pmt, flags, lp, lip, niflp, vlp)
|
||||
l = strlen (nprompt); /* XXX */
|
||||
r = ret = (char *)xmalloc (l + 1);
|
||||
|
||||
newlines_guess = (l / _rl_screenwidth) + 1;
|
||||
if (_rl_screenwidth == 0)
|
||||
_rl_get_screen_size (0, 0); /* avoid division by zero */
|
||||
|
||||
newlines_guess = (_rl_screenwidth > 0) ? APPROX_DIV(l, _rl_screenwidth) : APPROX_DIV(l, 80);
|
||||
local_prompt_newlines = (int *) xrealloc (local_prompt_newlines, sizeof (int) * (newlines_guess + 1));
|
||||
local_prompt_newlines[newlines = 0] = 0;
|
||||
for (rl = 1; rl <= newlines_guess; rl++)
|
||||
@@ -2629,7 +2634,8 @@ _rl_erase_at_end_of_line (l)
|
||||
}
|
||||
|
||||
/* Clear to the end of the line. COUNT is the minimum
|
||||
number of character spaces to clear, */
|
||||
number of character spaces to clear, but we use a terminal escape
|
||||
sequence if available. */
|
||||
void
|
||||
_rl_clear_to_eol (count)
|
||||
int count;
|
||||
@@ -2652,7 +2658,7 @@ space_to_eol (count)
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
putc (' ', rl_outstream);
|
||||
putc (' ', rl_outstream);
|
||||
|
||||
_rl_last_c_pos += count;
|
||||
}
|
||||
|
||||
+1
-1
@@ -740,7 +740,7 @@ rl_bracketed_paste_begin (count, key)
|
||||
return (retval);
|
||||
}
|
||||
|
||||
/* A special paste command for Windows users.. */
|
||||
/* A special paste command for Windows users. */
|
||||
#if defined (_WIN32)
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
@@ -419,7 +419,10 @@ readline_internal_setup ()
|
||||
#if defined (VI_MODE)
|
||||
if (rl_editing_mode == vi_mode)
|
||||
rl_vi_insertion_mode (1, 'i'); /* don't want to reset last */
|
||||
else
|
||||
#endif /* VI_MODE */
|
||||
if (_rl_show_mode_in_prompt)
|
||||
_rl_reset_prompt ();
|
||||
|
||||
/* If we're not echoing, we still want to at least print a prompt, because
|
||||
rl_redisplay will not do it for us. If the calling application has a
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
/* The next-to-last-ditch effort file name for a user-specific init file. */
|
||||
#define DEFAULT_INPUTRC "~/.inputrc"
|
||||
|
||||
/* The ultimate last-ditch filenname for an init file -- system-wide. */
|
||||
/* The ultimate last-ditch filename for an init file -- system-wide. */
|
||||
#define SYS_INPUTRC "/etc/inputrc"
|
||||
|
||||
/* If defined, expand tabs to spaces. */
|
||||
|
||||
@@ -594,7 +594,8 @@ rl_vi_bword (count, ignore)
|
||||
so we will go back to the start of the previous word. */
|
||||
if (!whitespace (rl_line_buffer[rl_point]) &&
|
||||
whitespace (rl_line_buffer[rl_point - 1]))
|
||||
rl_point--;
|
||||
if (--rl_point == 0)
|
||||
break;
|
||||
|
||||
/* If this character and the previous character are `opposite', move
|
||||
back so we don't get messed up by the rl_point++ down there in
|
||||
|
||||
Reference in New Issue
Block a user