Bug 238351

Summary: x11-clocks/xclock: xclock -strftime option misinterprets/mishandles the %n specification
Product: Ports & Packages Reporter: Ronald F. Guilmette <rfg-freebsd>
Component: Individual Port(s)Assignee: freebsd-x11 mailing list <x11>
Status: New ---    
Severity: Affects Only Me CC: rgrimes, zeising
Priority: --- Flags: bugzilla: maintainer-feedback? (x11)
Version: Latest   
Hardware: Any   
OS: Any   

Description Ronald F. Guilmette 2019-06-05 22:06:29 UTC
When xclock is invoked with both the -digital and -strftime options, the man page for xclock(1) suggests that the string given as the argument to the -strftime option will be interpreted as if it were a format specification given to the strftime() libc function.

This is mostly true with the exception of the %n (newline) conversion specification, which is utterly mishandled by xclock.  Instead of introducing a newline at that point in the rendered digital xclock image, xclock instead displays something that looks like an empty box character at the corresponding point in the rendered digital xclock image.

This is just wrong, and it obviously violates the Principal of Least Surprise.  If the user has explicitly requested a newline at some certain point in the format string, then he/she did so for a reason, and xclock should honor that request by splitting the rendered digital xclock image across two (or more) lines, exactly as the user had explicitly requested.  There is no compelling reason not to do so.
Comment 1 Niclas Zeising freebsd_committer 2019-07-29 12:35:23 UTC
This sounds like a bug in xclock itself, rather than the FreeBSD port of xclock.  Have you reported this upstream?
Comment 2 Ronald F. Guilmette 2019-07-29 21:19:02 UTC
I agree with your diagnosis, 100%, and no, I was meaning to report it to the xorg people, but I can't even remember now if I did or didn't.  So I probably didn't.  I'll see if I can do that now.

I guess that really, it is bugs.freedesktop.org where I should be reporting this, yes?

Well, I'll try that.  The worse that can happen is that they throw me out for being an ignorant idiot.
Comment 3 Niclas Zeising freebsd_committer 2019-07-29 21:34:55 UTC
(In reply to Ronald F. Guilmette from comment #2)
> I guess that really, it is bugs.freedesktop.org where I should be reporting
> this, yes?

I think it's better to report it in their gitlab, gitlab.freedesktop.org.
Thanks for looking into it!
Comment 4 Ronald F. Guilmette 2019-07-30 05:24:36 UTC
As requested, it has been done:

https://gitlab.freedesktop.org/xorg/app/xclock/issues/2

I am perfectly OK with the issue being closed now with respect to FreeBSD.