Created attachment 161039 [details]
patch to misc/lifelines src/stdlib/icvt.c to improve wide character support
I had been using misc/lifelines for years; up until a few weeks ago, I had no perceived need for wide character support, so I had LANG set to en_US.ISO8859-1 and LC_ALL set to C -- and things were generally working. In particular, I had no issues with misc/lifelines.
A few weeks ago, I became convinced that certain aspects of my life (unrelated to misc/lifelines) would become significantly easier if I were to switch to UTF-8, which I did. And once I got through the initial "turbulence," things seemed OK.
About a week later, I had occasion to use misc/lifelines for the first time since switching to UTF-8... and I found that every surname was now rendered as "?" -- which is a bit worse than merely annoying.
I whined about this on the lifelines list (LINES-L@LISTSERV.NODAK.EDU), received a couple of suggestions (essentially, switch the environment back to non-UTF-8) which did not work for me (quite possibly because I also now have the xterm*utf8 resource set to 1), so I spent a bit of quality time with gdb (the results of which I posted to the above-cited list).
In that post, I cited some things that looked a bit odd in the code; a couple of the responses zeroed in on a section of src/stdlib/icvt.c.
Accordingly, I hacked at the code a bit, fired up gmake, and ... the resulting executable actually seems to work properly now.
It's a one-line patch that essentially makes the one line more in keeping with the pattern of others in that context, rather than looking like a copy/paste error (as one of my correspondents put it); I've attached it.
For reference, I am using lifelines-3.0.62, running:
FreeBSD g1-252.catwhisker.org 10.2-STABLE FreeBSD 10.2-STABLE #146 r287776M/287779:1002500: Mon Sep 14 04:17:32 PDT 2015 firstname.lastname@example.org:/common/S1/obj/usr/src/sys/CANARY amd64
Ugh; silly me: I just noted that the paths on the patch aren't ideal -- should show "src/stdlib/icvt.c", rather than just "icvt.c". Sorry about that. :-(
The same patch was suggested on the LINES-L mailing list by Andy Feldt (for Mac OS X) in 2012 and the correctness was confirmed by a few people at that time.
I will try to get this fixed upstream, but need to sift through 10 years of non-maintainership at sourceforge first.
A commit references this bug:
Date: Fri Oct 23 13:09:11 UTC 2015
New revision: 400022
- Improve wide character (UTF-8) support, define LICENSE (MIT)
- Convert to option helpers and thus cleanup Makefile; running `make
package OPTIONS_UNSET=DOCS -DBATCH' will produce a docless package
without any pre-staging-era hacks in the Makefile
Submitted by: dhw
Approved by: maintainer
Committed as ports r400022 along with other changes, thanks David!