commit bash-20120928 snapshot

This commit is contained in:
Chet Ramey
2012-10-10 09:38:49 -04:00
parent 47b599dc52
commit 253e3c7085
3 changed files with 28 additions and 3 deletions
+11
View File
@@ -3622,3 +3622,14 @@ lib/readline/input.c
lib/readline/doc/rltech.texi
- rl_input_available_hook: document
9/27
----
lib/glob/sm_loop.c:
- GMATCH: after one or more `*', an instance of ?(x) can match zero or
1 times (unlike ?, which has to match one character). The old code
failed if it didn't match at least once. Fixes `a*?(x)' bug.
- GMATCH: if we hit the end of the search string, but not the end of
the pattern, and the rest of the pattern is something that can
match the NUL at the end of the search string, we should successfully
match. Fixes `a*!(x)' bug reported by <hans1worst@gmail.com>
+15 -2
View File
@@ -145,8 +145,9 @@ fprintf(stderr, "gmatch: pattern = %s; pe = %s\n", pattern, pe);
if (EXTMATCH (c, newn, se, p, pe, flags) == 0)
return (0);
}
/* We didn't match. If we have a `?(...)', that's failure. */
return FNM_NOMATCH;
/* We didn't match. If we have a `?(...)', we can match 0
or 1 times. */
return 0;
}
#endif
else if (c == L('?'))
@@ -192,6 +193,18 @@ fprintf(stderr, "gmatch: pattern = %s; pe = %s\n", pattern, pe);
if (p == pe && (c == L('?') || c == L('*')))
return (0);
/* If we've hit the end of the string and the rest of the pattern
is something that matches the empty string, we can succeed. */
#if defined (EXTENDED_GLOB)
if (n == se && ((flags & FNM_EXTMATCH) && (c == L('!') || c == L('?')) && *p == L('(')))
{
--p;
if (EXTMATCH (c, n, se, p, pe, flags) == 0)
return (c == L('!') ? FNM_NOMATCH : 0);
return (c == L('!') ? 0 : FNM_NOMATCH);
}
#endif
/* General case, use recursion. */
{
U_CHAR c1;
+2 -1
View File
@@ -449,7 +449,8 @@ source.
Readline queries for available input when implementing intra-key-sequence
timeouts during input and incremental searches.
This may use an application-specific timeout before returning a value;
Readline uses the value passed to @code{rl_set_keyboard_input_timeout()}.
Readline uses the value passed to @code{rl_set_keyboard_input_timeout()}
or the value of the user-settable @var{keyseq-timeout} variable.
This is designed for use by functions using Readline's callback interface
(@pxref{Alternate Interface}), which may not use the traditional
@code{read(2)} and file descriptor interface.