+
Skip to content

Conversation

cobaweel
Copy link
Contributor

@cobaweel cobaweel commented Nov 23, 2023

Fixes #5576

Issue 5576 reported a bug in expr, found by the fuzzer. The problem
turns out to be with the regex match operator :, which is defined in
POSIX and the GNU manual to match the pattern only when it occurs at
the beginning of the string, i.e., the regex has an implicit ^
prepended to it. We hadn't been doing that.

References:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/expr.html
https://www.gnu.org/software/coreutils/manual/html_node/String-expressions.html

@uutils uutils deleted a comment from github-actions bot Nov 23, 2023
Issue 5576 reported a bug in expr, found by the fuzzer. The problem
turns out to be with the regex match operator `:`, which is defined in
POSIX and the GNU manual to match the pattern only when it occurs at
the beginning of the string, i.e., the regex has an implicit `^`
prepended to it. We hadn't been doing that.
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/tail/symlink is no longer failing!

@cakebaker cakebaker merged commit 97d30bd into uutils:main Nov 23, 2023
@cakebaker
Copy link
Contributor

Thanks for your PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

expr: gnu generates a division by zero when we don't

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载