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>
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('?'))
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;
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.