2 ms·
A nit/bug re: the glob matching algorithm in use: '?' evidently represents "any character" per the !glob("h?i", "hi") test. But, if I add a test for glob("???
by vitus 6y ago
A nit/bug re: the glob matching algorithm in use:
'?' evidently represents "any character" per the !glob("h?i", "hi") test.
But, if I add a test for glob("???", "hi"), that succeeds unexpectedly even though it should run out of input.
I believe it's because the '?' case checks nt < text.length() (which AIUI is for consuming variable input for '*') instead of t. Changing that case to t < text.length() seems to fix that problem.
(This looks like it's the case for all four languages, as the glob algorithm looks identical in all four, modulo syntax differences)