commit 06e06a1507143728cf3909a23191d423331e64a4
parent b52162c32bcb8a8bf64ede7d12bd52fbf1cee2e6
Author: bakkeby <bakkeby@gmail.com>
Date: Sat, 16 Aug 2025 15:25:42 +0200
Support ^U for clearing password
^U is a fairly common key combo for clearing fields, this patch adds
support for it.
https://git.suckless.org/slock/commit/bf0a5577acbd9ec7c6a577601b97144b205840d7.html
https://git.suckless.org/slock/commit/3791a996e230aec59d61faea46634ae4f031e359.html
Diffstat:
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
@@ -1,5 +1,5 @@
-Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this slock 1.6 (e3fb343,
-2025-08-09) project has a different take on patching. It uses preprocessor directives to decide
+Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this slock 1.6 (3791a99,
+2025-08-16) project has a different take on patching. It uses preprocessor directives to decide
whether or not to include a patch during build time. Essentially this means that this build, for
better or worse, contains both the patched _and_ the original code. The aim being that you can
select which patches to include and the build will contain that code and nothing more.
diff --git a/slock.c b/slock.c
@@ -403,6 +403,9 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
{
memcpy(passwd + len, buf, num);
len += num;
+ } else if (buf[0] == '\025') { /* ctrl-u clears input */
+ explicit_bzero(&passwd, sizeof(passwd));
+ len = 0;
}
#if KEYPRESS_FEEDBACK_PATCH
if (blocks_enabled)