GNU nano - Bugs: bug #61487, in a UTF-8 locale, '\xčć' is...
You are not allowed to post comments on this tracker with your current authentication level.
bug #61487: in a UTF-8 locale, '\xčć' is colorized as valid hex in a C file
Submitter: | Benno Schulenberg <bens> | ||
Submitted: | Mon 15 Nov 2021 02:44:13 PM UTC | ||
Severity: | 2 - Minor | Status: | Fixed |
Assigned to: | bens | Open/Closed: | Closed |
Mon 22 Nov 2021 10:54:56 AM UTC, comment #5: |
Benno Schulenberg <bens> |
Sun 21 Nov 2021 09:50:39 PM UTC, comment #4: Putting `setlocale(LC_ALL, "")` in the test program makes the [0-9A-Fa-f] pattern match "čđ" on Linux systems, but not macOS.
|
Brad Town <townba> |
Sun 21 Nov 2021 07:13:41 PM UTC, comment #3: I was able to reproduce this bug on Debian (rodete) by using "./configure --without-included-regex". It goes away with a default configuration (what I'd used before) or "./configure --with-included-regex".
|
Brad Town <townba> |
Sun 21 Nov 2021 06:42:17 PM UTC, comment #2: This is a good change, but it shows that there's something else going on, perhaps with your system.
|
Brad Town <townba> |
Mon 15 Nov 2021 03:22:55 PM UTC, comment #1: Fixed in git, commit f757c4a5, by changing all ranges [0-9A-Fa-f] to [[:xdigit:]] -- and [0-9ABCDEFabcdef] too, for shortness and symmetry. |
Benno Schulenberg <bens> |
Mon 15 Nov 2021 02:44:13 PM UTC, original submission:
To reproduce, run in a UTF-8 locale:
Then paste this line into the file: '\xcd' '\xčđ'
|
Benno Schulenberg <bens> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 3 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2021-12-16 | bens | Open/Closed | Open | Closed | |
2021-11-15 | bens | Status | None | Fixed | |
Summary | in a UTF-8 locale, '\xčđ' is colorized as if it were valid hex in a C file | in a UTF-8 locale, '\xčć' is colorized as valid hex in a C file |
Powered by Savane 3.13-caa5.
Corresponding source code
Thanks for digging into this.
On my local systems and three remote systems (all Debian-based), echo 'čđ' | grep '[A-Fa-f]' matches. On five other remote systems (Alpine, Gentoo, the three BSDs), it doesn't match. (With LANG either nl_NL.UTF-8 or en_US.UTF-8.)
And indeed, after running a default ./configure (or with --with-included-regex), then in a nano syntax [A-Fa-f] does not match čđ. Strange. I think the latter is a bug in gnulib (or in the way nano uses gnulib), but... as long as no one complains about a specific use case they expect to work... I'm not going to bother with that.