[arch-commits] Commit in slock/trunk (PKGBUILD backspace.patch)

Sergej Pupykin spupykin at archlinux.org
Mon Mar 8 18:51:45 UTC 2021


    Date: Monday, March 8, 2021 @ 18:51:45
  Author: spupykin
Revision: 886951

upgpkg: slock 1.4-5

Added:
  slock/trunk/backspace.patch
Modified:
  slock/trunk/PKGBUILD

-----------------+
 PKGBUILD        |   10 ++++++----
 backspace.patch |   30 ++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-03-08 18:45:55 UTC (rev 886950)
+++ PKGBUILD	2021-03-08 18:51:45 UTC (rev 886951)
@@ -3,20 +3,22 @@
 
 pkgname=slock
 pkgver=1.4
-pkgrel=4
+pkgrel=5
 pkgdesc="A simple screen locker for X"
 arch=('x86_64')
 url="https://tools.suckless.org/slock"
 license=('MIT')
 depends=('libxext' 'libxrandr')
-source=("https://dl.suckless.org/tools/$pkgname-$pkgver.tar.gz")
-#source=("slock-$pkgver.tar.bz2::https://hg.suckless.org/slock/archive/$_pkgver.tar.gz")
-md5sums=('f91dd5ba50ce7bd1842caeca067086a3')
+source=("https://dl.suckless.org/tools/$pkgname-$pkgver.tar.gz"
+	"backspace.patch")
+sha256sums=('b53849dbc60109a987d7a49b8da197305c29307fd74c12dc18af0d3044392e6a'
+            '38041869ef4e3aef60dec64c2ee2c297f7d2e5fb873b748634fdfbcfc3834a97')
 
 prepare() {
   cd "$srcdir/slock-$pkgver"
   sed -i 's|static const char \*group = "nogroup";|static const char *group = "nobody";|' config.def.h
   sed -ri 's/((CPP|C|LD)FLAGS) =/\1 +=/g' config.mk
+  patch -p1 <../backspace.patch
 }
 
 build() {

Added: backspace.patch
===================================================================
--- backspace.patch	                        (rev 0)
+++ backspace.patch	2021-03-08 18:51:45 UTC (rev 886951)
@@ -0,0 +1,30 @@
+commit 35633d45672d14bd798c478c45d1a17064701aa9
+Author: Tobias Stoeckmann <tobias at stoeckmann.org>
+Date:   Sat Mar 25 21:16:01 2017 +0100
+
+    Properly clear the last entered character
+    
+    When enter is pressed, passwd[len] will be set to '\0'. Pressing
+    backspace is supposed to remove the last entered character.
+    
+    But currently, the clearing has an off-by-one, as in setting
+    passwd[len] to '\0' just like enter would do.
+    
+    You can also verify it by imagining len=1 and that it's impossible to
+    clear passwd[0] by pressing backspace with the current code.
+    
+    Signed-off-by: Tobias Stoeckmann <tobias at stoeckmann.org>
+
+diff --git a/slock.c b/slock.c
+index d55eb3d..5ae738c 100644
+--- a/slock.c
++++ b/slock.c
+@@ -177,7 +177,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
+ 				break;
+ 			case XK_BackSpace:
+ 				if (len)
+-					passwd[len--] = '\0';
++					passwd[--len] = '\0';
+ 				break;
+ 			default:
+ 				if (num && !iscntrl((int)buf[0]) &&



More information about the arch-commits mailing list