- 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>
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;
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.
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
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.
{
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 ();
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;
- }
-
- printf ("%s: %s\n", name, _(shell_builtins[i].short_doc));
-
- if (sflag == 0)
- show_longdoc (i);
+ QUIT;
+
+ /* 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 (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;
}
}
.\" 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.
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
.br
}
.br
-complete -D -F _completion_loader
+complete -D -F _completion_loader -o bashdefault -o default
.br
\fP
.SH HISTORY
.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
.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
@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}
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
{
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);
}
@{
. "/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
break;
s2++;
}
- while (--count != 0)
+ while (--count != 0);
return (0);
}