Page MenuHomeFreeBSD

libc: locale: fix terminal state check
Needs ReviewPublic

Authored by kevans on Apr 4 2025, 7:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 13 2025, 9:41 PM
Unknown Object (File)
Nov 12 2025, 5:50 PM
Unknown Object (File)
Nov 6 2025, 11:15 AM
Unknown Object (File)
Oct 31 2025, 9:32 PM
Unknown Object (File)
Oct 25 2025, 5:45 AM
Unknown Object (File)
Oct 23 2025, 6:52 PM
Unknown Object (File)
Oct 22 2025, 11:43 PM
Unknown Object (File)
Sep 21 2025, 8:44 PM
Subscribers

Details

Reviewers
bapt
yuripv
Group Reviewers
Klara
Summary

sptr can never be NULL at this point, based on the context. The
intent was clearly to check if *sptr is now 0 so that we zap the state
and freshly process the next lookup.

Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 63327
Build 60211: arc lint + arc unit

Event Timeline

kevans requested review of this revision.Apr 4 2025, 7:27 PM
lib/libc/locale/collate.c
340

Actually, it's not clear to me that the left half is correct, either.

markj added inline comments.
lib/libc/locale/collate.c
340

Right, that can never be true since it would otherwise imply that sptr == sptr + 1.

lib/libc/locale/collate.c
340

Yeah. I was wondering if it could be some kind of typo, but I can't imagine what the "correct" version would look like- I think I'll just remove it, as I can't see why we'd terminate any earlier than pri == 0.