commit 48e1b2505e717473d57a8f396cf7f3704d3cbe3a
parent 337648dee65041834adfa11f353bc9edb809faf3
Author: Markus Hanetzok <markus@hanetzok.net>
Date: Fri, 10 Oct 2025 14:49:13 +0200
apply controlclear patch
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/config.def.h b/config.def.h
@@ -46,3 +46,6 @@ static const int blurRadius=5;
/*Set pixelation radius*/
static const int pixelSize=0;
+/* allow control key to trigger fail on clear */
+static const int controlkeyclear = 1;
+
diff --git a/slock.c b/slock.c
@@ -222,8 +222,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;
} else if (buf[0] == '\025') { /* ctrl-u clears input */