[PATCH 1/1] paint visual host key with unicode box-drawing characters

Christian Hesse list at eworm.de
Mon Jul 6 20:42:53 AEST 2015


Alex Bligh <alex at alex.org.uk> on Mon, 2015/07/06 11:33:
> 
> On 6 Jul 2015, at 11:05, Christian Hesse <list at eworm.de> wrote:
> 
> > +#ifdef HAVE_LOCALE_H
> > +	char    *locale;
> > +	char    *border_utf8[]  = { "┏", "━", "┓", "┃", "┗", "┛" };
> > +#endif
> > +	char    *border_ascii[] = { "+", "-", "+", "|", "+", "+" };
> > +	char   **border;
> 
> What if LOCALE_H is present at compile time but the binary is then
> run in a non-unicode locale?

See below. setlocale() should return something without "utf-8" in its name,
so the binary should select the ascii characters.

This still has a serve issue, though: It works perfectly with ssh-keygen but
breaks for ssh... I will have a look at that.

However this is more like RFC, so comments are welcome.
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Chris           get my mail address:    */=0;b=c[a++];)
putchar(b-1/(/*               gcc -o sig sig.c && ./sig    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20150706/93156b6f/attachment-0001.bin>


More information about the openssh-unix-dev mailing list