commit bash-20130809 snapshot

This commit is contained in:
Chet Ramey
2013-09-12 08:54:38 -04:00
parent adbaf2b395
commit 9353cc0550
10 changed files with 97 additions and 37 deletions
+30 -1
View File
@@ -5130,10 +5130,39 @@ arrayfunc.c
- assign_array_element_internal: before using array_max_index() when
processing a negative subscript, make sure the variable is an array.
if it's not, use 0 as array_max_index assuming it's a string.
Bug report from Geir Hauge <geir.hauge@gmail.com>
Fixes bug report from Geir Hauge <geir.hauge@gmail.com>
8/3
---
Makefile.in
- pcomplete.o: add dependency on $(DEFDIR)/builtext.h. Suggested by
Curtis Doty <curtis@greenkey.net>
8/5
---
lib/glob/sm_loop.c
- strcompare: short-circuit and return FNM_NOMATCH if the lengths of the
pattern and string (pe - p and se - s, respectively) are not equal
- strcompare: don't bother trying to set *pe or *se to '\0' if that's
what they already are. Fixes bug reported by Geir Hauge
<geir.hauge@gmail.com>
8/6
---
doc/{bash.1,bashref.texi},builtins/hash.def,lib/readline/doc/rluser.texi
- minor typo changes from Geir Hauge <geir.hauge@gmail.com>
bultins/help.def
- show_longdoc: avoid trying to translate the empty string because it
often translates to some boilerplate about the project and
translation. Report and fix from Geir Hauge <geir.hauge@gmail.com>
8/8
---
builtins/help.def
- help_builtin: try two passes through the list of help topics for each
argument: one doing exact string matching and one, if the first pass
fails to find a match, doing string prefix matching like previous
versions. This prevents `help read' from matching both `read' and
`readonly', but allows `help r' to match everything beginning with
`r'. Inspired by report from Geir Hauge <geir.hauge@gmail.com>
+4
View File
@@ -510,6 +510,10 @@ fc_gethnum (command, hlist)
if (command == NULL)
return (i);
/* back up from the end to the last non-null history entry */
while (hlist[real_last] == 0 && real_last > 0)
real_last--;
/* Otherwise, there is a specification. It can be a number relative to
the current position, or an absolute history number. */
s = command;
+2 -2
View File
@@ -1,7 +1,7 @@
This file is hash.def, from which is created hash.c.
It implements the builtin "hash" in Bash.
Copyright (C) 1987-2010 Free Software Foundation, Inc.
Copyright (C) 1987-2013 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -31,7 +31,7 @@ no arguments are given, information about remembered commands is displayed.
Options:
-d forget the remembered location of each NAME
-l display in a format that may be reused as input
-p pathname use PATHNAME is the full pathname of NAME
-p pathname use PATHNAME as the full pathname of NAME
-r forget all remembered locations
-t print the remembered location of each NAME, preceding
each location with the corresponding NAME if multiple
+34 -20
View File
@@ -1,7 +1,7 @@
This file is help.def, from which is created help.c.
It implements the builtin "help" in Bash.
Copyright (C) 1987-2012 Free Software Foundation, Inc.
Copyright (C) 1987-2013 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -92,7 +92,7 @@ help_builtin (list)
{
register int i;
char *pattern, *name;
int plen, match_found, sflag, dflag, mflag;
int plen, match_found, sflag, dflag, mflag, m, pass, this_found;
dflag = sflag = mflag = 0;
reset_internal_getopt ();
@@ -137,29 +137,43 @@ help_builtin (list)
pattern = list->word->word;
plen = strlen (pattern);
for (i = 0; name = shell_builtins[i].name; i++)
for (pass = 1, this_found = 0; pass < 3; pass++)
{
QUIT;
if ((strcmp (pattern, name) == 0) ||
(strmatch (pattern, name, FNMATCH_EXTFLAG) != FNM_NOMATCH))
for (i = 0; name = shell_builtins[i].name; i++)
{
match_found++;
if (dflag)
{
show_desc (name, i);
continue;
}
else if (mflag)
{
show_manpage (name, i);
continue;
}
QUIT;
printf ("%s: %s\n", name, _(shell_builtins[i].short_doc));
/* First pass: look for exact string or pattern matches.
Second pass: look for prefix matches like bash-4.2 */
if (pass == 1)
m = (strcmp (pattern, name) == 0) ||
(strmatch (pattern, name, FNMATCH_EXTFLAG) != FNM_NOMATCH);
else
m = strncmp (pattern, name, plen) == 0;
if (sflag == 0)
show_longdoc (i);
if (m)
{
this_found = 1;
match_found++;
if (dflag)
{
show_desc (name, i);
continue;
}
else if (mflag)
{
show_manpage (name, i);
continue;
}
printf ("%s: %s\n", name, _(shell_builtins[i].short_doc));
if (sflag == 0)
show_longdoc (i);
}
}
if (pass == 1 && this_found == 1)
break;
}
}
+6 -6
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Thu Aug 1 15:59:19 EDT 2013
.\" Last Change: Tue Aug 6 09:55:50 EDT 2013
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2013 August 1" "GNU Bash 4.3"
.TH BASH 1 "2013 August 6" "GNU Bash 4.3"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -2372,7 +2372,7 @@ The value of \fIp\fP determines whether or not the fraction is
included.
.IP
If this variable is not set, \fBbash\fP acts as if it had the
value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\e\t%3lS\(aq\fP.
value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\ett%3lS\(aq\fP.
If the value is null, no timing information is displayed.
A trailing newline is added when the format string is displayed.
.PD 0
@@ -6375,7 +6375,7 @@ completion function would load completions dynamically:
.br
}
.br
complete -D -F _completion_loader
complete -D -F _completion_loader -o bashdefault -o default
.br
\fP
.SH HISTORY
@@ -10081,7 +10081,7 @@ subsequently reset. The exit status is true unless a
.I name
is readonly.
.TP
\fBwait\fP [\fB\--n\fP] [\fIn ...\fP]
\fBwait\fP [\fB\-n\fP] [\fIn ...\fP]
Wait for each specified child process and return its termination status.
Each
.I n
@@ -10091,7 +10091,7 @@ in that job's pipeline are waited for. If
.I n
is not given, all currently active child processes
are waited for, and the return status is zero.
If the \fB\--n\fP option is supplied, \fBwait\fP waits for any job to
If the \fB\-n\fP option is supplied, \fBwait\fP waits for any job to
terminate and returns its exit status.
If
.I n
+1 -1
View File
@@ -7586,7 +7586,7 @@ or non-zero if an error occurs or an invalid option is encountered.
@item wait
@btindex wait
@example
wait [@var{jobspec} or @var{pid} @dots{}]
wait [-n] [@var{jobspec} or @var{pid} @dots{}]
@end example
Wait until the child process specified by each process @sc{id} @var{pid}
+2 -2
View File
@@ -2,9 +2,9 @@
Copyright (C) 1988-2013 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Thu Aug 1 15:58:51 EDT 2013
@set LASTCHANGE Tue Aug 6 09:56:12 EDT 2013
@set EDITION 4.3
@set VERSION 4.3
@set UPDATED 1 August 2013
@set UPDATED 6 August 2013
@set UPDATED-MONTH August 2013
+16 -3
View File
@@ -626,19 +626,32 @@ STRCOMPARE (p, pe, s, se)
{
int ret;
CHAR c1, c2;
int l1, l2;
l1 = pe - p;
l2 = se - s;
if (l1 != l2)
return (FNM_NOMATCH); /* unequal lengths, can't be identical */
c1 = *pe;
c2 = *se;
*pe = *se = '\0';
if (c1 != 0)
*pe = '\0';
if (c2 != 0)
*se = '\0';
#if HAVE_MULTIBYTE || defined (HAVE_STRCOLL)
ret = STRCOLL ((XCHAR *)p, (XCHAR *)s);
#else
ret = STRCMP ((XCHAR *)p, (XCHAR *)s);
#endif
*pe = c1;
*se = c2;
if (c1 != 0)
*pe = c1;
if (c2 != 0)
*se = c2;
return (ret == 0 ? ret : FNM_NOMATCH);
}
+1 -1
View File
@@ -1833,7 +1833,7 @@ _completion_loader()
@{
. "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
@}
complete -D -F _completion_loader
complete -D -F _completion_loader -o bashdefault -o default
@end example
@node Programmable Completion Builtins
+1 -1
View File
@@ -393,7 +393,7 @@ _rl_strnicmp (string1, string2, count)
break;
s2++;
}
while (--count != 0)
while (--count != 0);
return (0);
}