commit bash-20150320 snapshot

This commit is contained in:
Chet Ramey
2015-03-25 10:08:06 -04:00
parent 0568080fce
commit 06c3a57511
35 changed files with 460 additions and 80 deletions
+19 -11
View File
@@ -128,10 +128,9 @@ _rl_print_color_indicator (char *f)
const char* name;
char *filename;
struct stat astat;
struct stat astat, linkstat;
mode_t mode;
int linkok;
int linkok; /* 1 == ok, 0 == dangling symlink, -1 == missing */
int stat_ok;
name = f;
@@ -150,10 +149,20 @@ _rl_print_color_indicator (char *f)
#else
stat_ok = stat(name, &astat);
#endif
if( stat_ok == 0 ) {
mode = astat.st_mode;
linkok = 1; //f->linkok;
}
if (stat_ok == 0)
{
mode = astat.st_mode;
#if defined (HAVE_LSTAT)
if (S_ISLNK (mode))
{
linkok = stat (name, &linkstat) == 0;
if (linkok && strncmp (_rl_color_indicator[C_LINK].string, "target", 6) == 0)
mode = linkstat.st_mode;
}
else
#endif
linkok = 1;
}
else
linkok = -1;
@@ -161,6 +170,8 @@ _rl_print_color_indicator (char *f)
if (linkok == -1 && _rl_color_indicator[C_MISSING].string != NULL)
colored_filetype = C_MISSING;
else if (linkok == 0 && S_ISLNK(mode) && _rl_color_indicator[C_ORPHAN].string != NULL)
colored_filetype = C_ORPHAN; /* dangling symlink */
else if(stat_ok != 0)
{
static enum indicator_no filetype_indicator[] = FILETYPE_INDICATORS;
@@ -201,10 +212,7 @@ _rl_print_color_indicator (char *f)
#endif
}
else if (S_ISLNK (mode))
colored_filetype = ((linkok == 0
&& (!strncmp (_rl_color_indicator[C_LINK].string, "target", 6)
|| _rl_color_indicator[C_ORPHAN].string))
? C_ORPHAN : C_LINK);
colored_filetype = C_LINK;
else if (S_ISFIFO (mode))
colored_filetype = C_FIFO;
else if (S_ISSOCK (mode))
+1 -1
View File
@@ -354,7 +354,7 @@ readline equivalents.
.TP
.B blink\-matching\-paren (Off)
If set to \fBOn\fP, readline attempts to briefly move the cursor to an
opening parenthesis when a closing parenthsis is inserted.
opening parenthesis when a closing parenthesis is inserted.
.TP
.B colored\-completion\-prefix (Off)
If set to \fBOn\fP, when listing completions, readline displays the
+1 -1
View File
@@ -430,7 +430,7 @@ Readline equivalents.
@item blink-matching-paren
@vindex blink-matching-paren
If set to @samp{on}, Readline attempts to briefly move the cursor to an
opening parenthesis when a closing parenthsis is inserted. The default
opening parenthesis when a closing parenthesis is inserted. The default
is @samp{off}.
@item colored-completion-prefix