glob: fix wrong return code when aborting before any matches
commit79bdacff83a6bd5b70ff5ae5eb8b6de82c2f7c30
authorRich Felker <dalias@aerifal.cx>
Thu, 24 Aug 2023 16:54:51 +0000 (24 12:54 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 24 Aug 2023 16:54:51 +0000 (24 12:54 -0400)
tree521b95b20cb0b110562dc1738c7fc241686ea243
parent7291c6c66a8d033bb487e6d8c8b003c8a7b6a550
glob: fix wrong return code when aborting before any matches

when the result count was zero, glob was ignoring a possible
GLOB_ABORTED error code and returning GLOB_NOMATCH. whether this
happened could be nondeterministic and dependent on the order of
dirent enumeration, in cases where multiple matches were present and
only some produced errors.

caught by Tor's test_util_glob.
src/regex/glob.c