Re: [dev] [dmenu] [PATCH] Added option to prompt for passwords

From: FRIGN <dev_AT_frign.de>
Date: Mon, 25 Jul 2016 23:10:26 +0200

On Mon, 25 Jul 2016 11:39:55 -0700
Eric Pruitt <eric.pruitt_AT_gmail.com> wrote:

> The attached patch adds a "-g" flag to dmenu so it can be used for
> password entry. Typed text is replaced with asterisks.

I looked more closely at the patch and I've found potential to simplify
it. Why not go with a
        static char asterisks[BUFSIZ];

and do a
        drw_font_getexts(drw->fonts, text, cursor, &curpos, NULL);
        memset(asterisks, '*', curpos / 8);
        asterisks[curpos / 8] = '\0';
        drw_text(drw, x, 0, w, bh, lrpad / 2, asterisks, 0);
or something along the lines.

Cheers

FRIGN

-- 
FRIGN <dev_AT_frign.de>
Received on Mon Jul 25 2016 - 23:10:26 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 25 2016 - 23:12:12 CEST