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

[[:space:]] and [[:blank:] character classes not working as expected in nvi #38742

Closed
chase-net opened this issue Aug 17, 2022 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@chase-net
Copy link

Is this a new report?

Yes

System Info

Void 5.18.17_1 x86_64-musl GenuineIntel notuptodate hold rFFF

Package(s) Affected

nvi-1.81.6_17

Does a report exist for this bug with the project's home (upstream) and/or another distro?

No response

Expected behaviour

Searching should match space and tab characters when using the POSIX character classes [:space:] and [:blank:].

Actual behaviour

[:space:] and [:blank:] seem to match the [:alnum:] character class.

Steps to reproduce

  1. Start vi. EXINIT= vi
  2. Insert some text including spaces and alphanumeric characters and return to normal mode. ia b c d<esc>
  3. Search for the character classes [:space:] or [:blank:]. /[[:space:]]
  4. Cycle through matches with n.
@chase-net chase-net added bug Something isn't working needs-testing Testing a PR or reproducing an issue needed labels Aug 17, 2022
@abenson abenson removed the needs-testing Testing a PR or reproducing an issue needed label Aug 19, 2022
@abenson
Copy link
Contributor

abenson commented Aug 19, 2022

This isn't a Void issue, this should be brought up with nvi upstream.

FWIW the behavior on Void's nvi seems consistent with other distributions (tested on Debian).

@abenson abenson closed this as completed Aug 19, 2022
@sgn
Copy link
Member

sgn commented Aug 19, 2022

Yes, nvi uses nvi bundled regexp(3) not libc's one. It can't be compiled with libc's regexp(3) at least with musl, since it uses REG_STARTEND which is an BSD-extension. IOW, maybe upstream regexp(3) was buggy.

sgn added a commit that referenced this issue Aug 19, 2022
@sgn
Copy link
Member

sgn commented Aug 19, 2022

Anyway, the character classes has been fix.

@chase-net
Copy link
Author

It seems this was fixed in the upstream as well. The latest snapshot compiles without patches and has this and #38741 fixed.

@sgn
Copy link
Member

sgn commented Aug 19, 2022

It seems this was fixed in the upstream as well. The latest snapshot compiles without patches and has this and #38741 fixed.

Ask them for a release, then.
Quoting https://repo.or.cz/nvi.git/blob/HEAD:/README.1st#l1

This is a development version of nvi.
Use at your own risk.

For this bug, it can be traced easily, but #38741 is hard to trace.

@chase-net
Copy link
Author

Ask them for a release, then.

Will do. Thank you for the patches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants