[wiki] [sites] Update slock control-clear patch to HEAD || David Phillips

From: <git_AT_suckless.org>
Date: Tue, 11 Oct 2016 14:33:20 +0200

commit e4f5b61e79897e910f30265d8989f65c634699e5
Author: David Phillips <david_AT_sighup.nz>
Date: Wed Oct 12 01:31:46 2016 +1300

    Update slock control-clear patch to HEAD

diff --git a/tools.suckless.org/slock/patches/control-clear.md b/tools.suckless.org/slock/patches/control-clear.md
index 26cf69e..33604e6 100644
--- a/tools.suckless.org/slock/patches/control-clear.md
+++ b/tools.suckless.org/slock/patches/control-clear.md
_AT_@ -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
deleted file mode 100644
index 248dc87..0000000
--- a/tools.suckless.org/slock/patches/slock-git-20160406-control-clear.diff
+++ /dev/null
_AT_@ -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
-_AT_@ -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
-_AT_@ -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
new file mode 100644
index 0000000..b9634cd
--- /dev/null
+++ b/tools.suckless.org/slock/patches/slock-git-20161012-control-clear.diff
_AT_@ -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
+_AT_@ -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
+_AT_@ -180,8 +180,9 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
+ passwd[len--] = '
Received on Tue Oct 11 2016 - 14:33:20 CEST

This archive was generated by hypermail 2.3.0 : Tue Oct 11 2016 - 14:36:16 CEST