+
Skip to content

Conversation

tgrez
Copy link
Contributor

@tgrez tgrez commented Jun 11, 2025

Fixes #8063

Changed parsing of expr substr arguments, so they have a higher precedence than whatever follows. Before those changes the parser was too eager and gave incorrect results when expr substr arguments were followed by bash conditional ("!="). The script used to reproduce the issue now gives the correct result.

Looking forward to feedback for this short PR :)

Fixes for index, length, match will come, if actually needed, in future PR(s).

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

@cakebaker cakebaker merged commit 3a087aa into uutils:main Jun 12, 2025
75 checks passed
@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 substr "$list" $len2 1 != " " different behavior with the GNU implementation

2 participants

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