Skip to content

expr: incorrectly handle regexp and breaks configure scripts #7880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zhw2101024 opened this issue May 4, 2025 · 8 comments · Fixed by #7884
Closed

expr: incorrectly handle regexp and breaks configure scripts #7880

zhw2101024 opened this issue May 4, 2025 · 8 comments · Fixed by #7884
Labels

Comments

@zhw2101024
Copy link
Contributor

The PR #7842 changed the way expr handle regexp, breaking configure scripts created by autotools.

#export C=coreutils/target/debug/

${C}expr xstatic : '.*[^-+._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]'    #0
@sylvestre
Copy link
Contributor

@frendsick could you please have a look? Thanks

@frendsick
Copy link
Contributor

Where can I find the failing configure scripts?

@zhw2101024
Copy link
Contributor Author

zhw2101024 commented May 4, 2025

I'm building a system following LFS project, and use uutils instead of coreutils. then the check package can't be configured before i dropped the --disable-static option. rerunning with bash -x and i found the fail case in this issue.
The latest released version of uutils is ok.

@zhw2101024
Copy link
Contributor Author

Where can I find the failing configure scripts?

I looked through the changes, and it seems we need a way to distinguish the '^' character: the beginning position or 'a character not in the following list'

@frendsick
Copy link
Contributor

Thank you for the help, I see the problem. I verified that the GNU expr does use the ^ character as the character class negation when it is the first character after [ inside a character class.

I will try to fix this.

@zhw2101024
Copy link
Contributor Author

Thank you for the help, I see the problem. I verified that the GNU expr does use the ^ character as the character class negation when it is the first character after [ inside a character class.

I will try to fix this.

Great, glad to hear that.

@frendsick
Copy link
Contributor

@zhw2101024 I created PR #7884 that should fix this. Please test the changes if you want.

@zhw2101024
Copy link
Contributor Author

zhw2101024 commented May 4, 2025

@zhw2101024 I created PR #7884 that should fix this. Please test the changes if you want.

The configure script works well with PR #7884. Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants