Skip to content
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

Add newer regex support #35

Open
dmik opened this issue Apr 5, 2017 · 2 comments
Open

Add newer regex support #35

dmik opened this issue Apr 5, 2017 · 2 comments

Comments

@dmik
Copy link
Contributor

dmik commented Apr 5, 2017

Versions of regcomp()/regexec()/etc in kLIBC seem to be quite old. In particular, they don't support the range [A-~] (i.e. all characters between ASCII A and ASCII ~ (tilde)) complaining with regex error 11 (Invalid range end). This was discovered when using the file magic database (magic.mgc) from file v5.30 in rpmbuild (this magic.mgc contains bioinformatics magic data which contains the following regex that fails: ^[!-?A-~]{1,255}(\t[^\t]+){11}).

A temporary workaround is to replace the faulty regex with

^[!-?A-Z\[\\\]\^_`a-z\\{|\\}~]{1,255}(\t[^\t]+){11}

and rebuild magic.mgc.

@dmik
Copy link
Contributor Author

dmik commented Apr 5, 2017

As Silvan reports, grep provides updated regcomp() and friends and these support the tilde quite well. We need to use them in LIBCx to override kLIBC ones for the time being.

@dmik
Copy link
Contributor Author

dmik commented Apr 5, 2017

Note that once it's done, http://trac.netlabs.org/ports/changeset/2170 needs to be rolled back.

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

No branches or pull requests

1 participant