commit bash-20150807 snapshot

This commit is contained in:
Chet Ramey
2015-08-11 16:41:53 -04:00
parent d54a780601
commit e9eee9d4b0
29 changed files with 317 additions and 73 deletions
+1 -1
View File
@@ -340,7 +340,7 @@ mlocation_register_alloc (file, line)
int line;
{
ma_table_t *lentry;
char *nfile;
const char *nfile;
if (file == 0)
{
+1 -1
View File
@@ -65,7 +65,7 @@ extern void mregister_dump_table __P((void));
extern void mregister_table_init __P((void));
typedef struct ma_table {
char *file;
const char *file;
int line;
int nalloc;
} ma_table_t;
+1 -1
View File
@@ -120,7 +120,7 @@ _rl_print_prefix_color (void)
/* Returns whether any color sequence was printed. */
bool
_rl_print_color_indicator (char *f)
_rl_print_color_indicator (const char *f)
{
enum indicator_no colored_filetype;
COLOR_EXT_TYPE *ext; /* Color extension */
+1 -1
View File
@@ -120,7 +120,7 @@ enum filetype
extern void _rl_put_indicator (const struct bin_str *ind);
extern void _rl_set_normal_color (void);
extern bool _rl_print_prefix_color (void);
extern bool _rl_print_color_indicator (char *f);
extern bool _rl_print_color_indicator (const char *f);
extern void _rl_prep_non_filename_text (void);
#endif /* !_COLORS_H_ */
+2 -2
View File
@@ -111,7 +111,7 @@ static int stat_char PARAMS((char *));
#endif
#if defined (COLOR_SUPPORT)
static int colored_stat_start PARAMS((char *));
static int colored_stat_start PARAMS((const char *));
static void colored_stat_end PARAMS((void));
static int colored_prefix_start PARAMS((void));
static void colored_prefix_end PARAMS((void));
@@ -676,7 +676,7 @@ stat_char (filename)
#if defined (COLOR_SUPPORT)
static int
colored_stat_start (filename)
char *filename;
const char *filename;
{
_rl_set_normal_color ();
return (_rl_print_color_indicator (filename));
+18
View File
@@ -63,6 +63,12 @@
extern char *xmalloc PARAMS((size_t));
void initialize_readline PARAMS((void));
void too_dangerous PARAMS((char *));
int execute_line PARAMS((char *));
int valid_argument PARAMS((char *, char *));
/* The names of functions that actually do the manipulation. */
int com_list PARAMS((char *));
int com_view PARAMS((char *));
@@ -119,6 +125,7 @@ dupstr (s)
return (r);
}
int
main (argc, argv)
int argc;
char **argv;
@@ -241,6 +248,7 @@ char **fileman_completion PARAMS((const char *, int, int));
/* Tell the GNU Readline library how to complete. We want to try to complete
on command names if this is the first word in the line, or on filenames
if not. */
void
initialize_readline ()
{
/* Allow conditional parsing of the ~/.inputrc file. */
@@ -317,6 +325,7 @@ command_generator (text, state)
static char syscom[1024];
/* List the file(s) named in arg. */
int
com_list (arg)
char *arg;
{
@@ -327,6 +336,7 @@ com_list (arg)
return (system (syscom));
}
int
com_view (arg)
char *arg;
{
@@ -342,6 +352,7 @@ com_view (arg)
return (system (syscom));
}
int
com_rename (arg)
char *arg;
{
@@ -349,6 +360,7 @@ com_rename (arg)
return (1);
}
int
com_stat (arg)
char *arg;
{
@@ -377,6 +389,7 @@ com_stat (arg)
return (0);
}
int
com_delete (arg)
char *arg;
{
@@ -386,6 +399,7 @@ com_delete (arg)
/* Print out help for ARG, or for all of the commands if ARG is
not present. */
int
com_help (arg)
char *arg;
{
@@ -425,6 +439,7 @@ com_help (arg)
}
/* Change to the directory ARG. */
int
com_cd (arg)
char *arg;
{
@@ -439,6 +454,7 @@ com_cd (arg)
}
/* Print out the current working directory. */
int
com_pwd (ignore)
char *ignore;
{
@@ -456,6 +472,7 @@ com_pwd (ignore)
}
/* The user wishes to quit using this program. Just set DONE non-zero. */
int
com_quit (arg)
char *arg;
{
@@ -464,6 +481,7 @@ com_quit (arg)
}
/* Function which tells you that you can't do this. */
void
too_dangerous (caller)
char *caller;
{
+1
View File
@@ -28,6 +28,7 @@
# include <config.h>
#endif
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
+14 -1
View File
@@ -930,6 +930,16 @@ _rl_dispatch_subseq (key, map, got_subseq)
/* Allocate new context here. Use linked contexts (linked through
cxt->ocxt) to simulate recursion */
#if defined (READLINE_CALLBACKS)
# if defined (VI_MODE)
/* If we're redoing a vi mode command and we know there is a shadowed
function corresponding to this key, just call it -- all the redoable
vi mode commands already have all the input they need, and rl_vi_redo
assumes that one call to rl_dispatch is sufficient to complete the
command. */
if (_rl_vi_redoing && RL_ISSTATE (RL_STATE_CALLBACK) &&
map[ANYOTHERKEY].function != 0)
return (_rl_subseq_result (-2, map, key, got_subseq));
# endif
if (RL_ISSTATE (RL_STATE_CALLBACK))
{
/* Return 0 only the first time, to indicate success to
@@ -992,6 +1002,7 @@ _rl_dispatch_subseq (key, map, got_subseq)
}
break;
}
#if defined (VI_MODE)
if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
key != ANYOTHERKEY &&
@@ -1037,7 +1048,9 @@ _rl_subseq_result (r, map, key, got_subseq)
m[key].type = type;
m[key].function = func;
r = _rl_dispatch (key, m);
/* Don't change _rl_dispatching_keymap, set it here */
_rl_dispatching_keymap = map; /* previous map */
r = _rl_dispatch_subseq (key, m, 0);
m[key].type = nt;
m[key].function = nf;
}
+1 -1
View File
@@ -873,7 +873,7 @@ extern int rl_inhibit_completion;
#define RL_STATE_CHARSEARCH 0x0800000 /* vi mode char search */
#define RL_STATE_REDISPLAYING 0x1000000 /* updating terminal display */
#define RL_STATE_DONE 0x1000000 /* done; accepted line */
#define RL_STATE_DONE 0x2000000 /* done; accepted line */
#define RL_SETSTATE(x) (rl_readline_state |= (x))
#define RL_UNSETSTATE(x) (rl_readline_state &= ~(x))
+1
View File
@@ -558,6 +558,7 @@ extern int _rl_undo_group_level;
/* vi_mode.c */
extern int _rl_vi_last_command;
extern int _rl_vi_redoing;
extern _rl_vimotion_cxt *_rl_vimvcxt;
#endif /* _RL_PRIVATE_H_ */
+1 -1
View File
@@ -58,7 +58,7 @@ _rl_search_cxt *_rl_nscxt = 0;
extern HIST_ENTRY *_rl_saved_line_for_history;
/* Functions imported from the rest of the library. */
extern int _rl_free_history_entry PARAMS((HIST_ENTRY *));
extern void _rl_free_history_entry PARAMS((HIST_ENTRY *));
static char *noninc_search_string = (char *) NULL;
static int noninc_history_pos;
+16 -14
View File
@@ -67,6 +67,9 @@ int _rl_vi_last_command = 'i'; /* default `.' puts you in insert mode */
_rl_vimotion_cxt *_rl_vimvcxt = 0;
/* Non-zero indicates we are redoing a vi-mode command with `.' */
int _rl_vi_redoing;
/* Non-zero means enter insertion mode. */
static int _rl_vi_doing_insert;
@@ -100,8 +103,6 @@ static int _rl_vi_last_replacement;
static int _rl_vi_last_key_before_insert;
static int vi_redoing;
/* Text modification commands. These are the `redoable' commands. */
static const char * const vi_textmod = "_*\\AaIiCcDdPpYyRrSsXx~";
@@ -241,7 +242,7 @@ rl_vi_redo (count, c)
}
r = 0;
vi_redoing = 1;
_rl_vi_redoing = 1;
/* If we're redoing an insert with `i', stuff in the inserted text
and do not go into insertion mode. */
if (_rl_vi_last_command == 'i' && vi_insert_buffer && *vi_insert_buffer)
@@ -287,7 +288,8 @@ rl_vi_redo (count, c)
}
else
r = _rl_dispatch (_rl_vi_last_command, _rl_keymap);
vi_redoing = 0;
_rl_vi_redoing = 0;
return (r);
}
@@ -1335,12 +1337,12 @@ rl_vi_delete_to (count, key)
_rl_vimvcxt->motion = '$';
r = rl_domove_motion_callback (_rl_vimvcxt);
}
else if (vi_redoing && _rl_vi_last_motion != 'd') /* `dd' is special */
else if (_rl_vi_redoing && _rl_vi_last_motion != 'd') /* `dd' is special */
{
_rl_vimvcxt->motion = _rl_vi_last_motion;
r = rl_domove_motion_callback (_rl_vimvcxt);
}
else if (vi_redoing) /* handle redoing `dd' here */
else if (_rl_vi_redoing) /* handle redoing `dd' here */
{
_rl_vimvcxt->motion = _rl_vi_last_motion;
rl_mark = rl_end;
@@ -1385,7 +1387,7 @@ vi_change_dispatch (m)
if ((_rl_to_upper (m->motion) == 'W') && rl_point < m->start)
rl_point = m->start;
if (vi_redoing)
if (_rl_vi_redoing)
{
if (vi_insert_buffer && *vi_insert_buffer)
rl_begin_undo_group ();
@@ -1425,12 +1427,12 @@ rl_vi_change_to (count, key)
_rl_vimvcxt->motion = '$';
r = rl_domove_motion_callback (_rl_vimvcxt);
}
else if (vi_redoing && _rl_vi_last_motion != 'c') /* `cc' is special */
else if (_rl_vi_redoing && _rl_vi_last_motion != 'c') /* `cc' is special */
{
_rl_vimvcxt->motion = _rl_vi_last_motion;
r = rl_domove_motion_callback (_rl_vimvcxt);
}
else if (vi_redoing) /* handle redoing `cc' here */
else if (_rl_vi_redoing) /* handle redoing `cc' here */
{
_rl_vimvcxt->motion = _rl_vi_last_motion;
rl_mark = rl_end;
@@ -1494,12 +1496,12 @@ rl_vi_yank_to (count, key)
_rl_vimvcxt->motion = '$';
r = rl_domove_motion_callback (_rl_vimvcxt);
}
else if (vi_redoing && _rl_vi_last_motion != 'y') /* `yy' is special */
else if (_rl_vi_redoing && _rl_vi_last_motion != 'y') /* `yy' is special */
{
_rl_vimvcxt->motion = _rl_vi_last_motion;
r = rl_domove_motion_callback (_rl_vimvcxt);
}
else if (vi_redoing) /* handle redoing `yy' here */
else if (_rl_vi_redoing) /* handle redoing `yy' here */
{
_rl_vimvcxt->motion = _rl_vi_last_motion;
rl_mark = rl_end;
@@ -1719,7 +1721,7 @@ rl_vi_char_search (count, key)
break;
}
if (vi_redoing)
if (_rl_vi_redoing)
{
/* set target and tlen below */
}
@@ -1955,7 +1957,7 @@ rl_vi_change_char (count, key)
int c;
char mb[MB_LEN_MAX];
if (vi_redoing)
if (_rl_vi_redoing)
{
c = _rl_vi_last_replacement;
mb[0] = c;
@@ -1983,7 +1985,7 @@ rl_vi_subst (count, key)
int count, key;
{
/* If we are redoing, rl_vi_change_to will stuff the last motion char */
if (vi_redoing == 0)
if (_rl_vi_redoing == 0)
rl_stuff_char ((key == 'S') ? 'c' : 'l'); /* `S' == `cc', `s' == `cl' */
return (rl_vi_change_to (count, 'c'));
+4 -2
View File
@@ -309,7 +309,7 @@ static int speeds[] =
};
__private_extern__
void
int
tputs (str, nlines, outfun)
register char *str;
int nlines;
@@ -335,7 +335,7 @@ tputs (str, nlines, outfun)
#endif
if (!str)
return;
return -1;
while (*str >= '0' && *str <= '9')
{
@@ -372,6 +372,8 @@ tputs (str, nlines, outfun)
while (padcount-- > 0)
(*outfun) (PC);
return 0;
}
/* Finding the termcap entry in the termcap data base. */
+1 -1
View File
@@ -29,7 +29,7 @@ extern char *tgetstr (const char *name, char **area);
extern char PC;
extern short ospeed;
extern void tputs (const char *string, int nlines, int (*outfun) (int));
extern int tputs (const char *string, int nlines, int (*outfun) (int));
extern char *tparam (const char *ctlstring, char *buffer, int size, ...);