sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit e4f5b61e79897e910f30265d8989f65c634699e5
parent 4e24992464fe5e9be6eb7685462679c6aeea4fe8
Author: David Phillips <david@sighup.nz>
Date:   Wed, 12 Oct 2016 01:31:46 +1300

Update slock control-clear patch to HEAD

Diffstat:
Mtools.suckless.org/slock/patches/control-clear.md | 2+-
Dtools.suckless.org/slock/patches/slock-git-20160406-control-clear.diff | 26--------------------------
Atools.suckless.org/slock/patches/slock-git-20161012-control-clear.diff | 27+++++++++++++++++++++++++++
3 files changed, 28 insertions(+), 27 deletions(-)

diff --git a/tools.suckless.org/slock/patches/control-clear.md b/tools.suckless.org/slock/patches/control-clear.md @@ -12,7 +12,7 @@ failed unlocking attempts. Download -------- -* [slock-git-20160406-control-clear.diff](slock-git-20160406-control-clear.diff) +* [slock-git-20161012-control-clear.diff](slock-git-20161012-control-clear.diff) Author ------ diff --git a/tools.suckless.org/slock/patches/slock-git-20160406-control-clear.diff b/tools.suckless.org/slock/patches/slock-git-20160406-control-clear.diff @@ -1,26 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index eae2d9a..c81908a 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -6,3 +6,6 @@ static const char *colorname[NUMCOLS] = { - - /* treat a cleared input like a wrong password */ - static const int failonclear = 1; -+ -+/* allow control key to trigger fail on clear */ -+static const int controlkeyclear = 0; -diff --git a/slock.c b/slock.c -index c9cdee2..43f6e97 100644 ---- a/slock.c -+++ b/slock.c -@@ -171,7 +171,9 @@ readpw(Display *dpy, const char *pws) - --len; - break; - default: -- if (num && !iscntrl((int)buf[0]) && (len + num < sizeof(passwd))) { -+ if (controlkeyclear && iscntrl((int)buf[0])) -+ continue; -+ if (num && (len + num < sizeof(passwd))) { - memcpy(passwd + len, buf, num); - len += num; - } diff --git a/tools.suckless.org/slock/patches/slock-git-20161012-control-clear.diff b/tools.suckless.org/slock/patches/slock-git-20161012-control-clear.diff @@ -0,0 +1,27 @@ +diff --git a/config.def.h b/config.def.h +index 6fba2b6..933152b 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -10,3 +10,6 @@ static const char *colorname[NUMCOLS] = { + + /* treat a cleared input like a wrong password */ + static const int failonclear = 1; ++ ++/* allow control key to trigger fail on clear */ ++static const int controlkeyclear = 0; +diff --git a/slock.c b/slock.c +index 4d7f06f..15552ef 100644 +--- a/slock.c ++++ b/slock.c +@@ -180,8 +180,9 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, + passwd[len--] = '\0'; + break; + default: +- if (num && !iscntrl((int)buf[0]) && +- (len + num < sizeof(passwd))) { ++ if (controlkeyclear && iscntrl((int)buf[0])) ++ continue; ++ if (num && (len + num < sizeof(passwd))) { + memcpy(passwd + len, buf, num); + len += num; + }