<feed xmlns='http://www.w3.org/2005/Atom'>
<title>swaylock/.git/include/unicode.h, branch v1.7.2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/'/>
<entry>
<title>Delete whole utf8 character on backspace</title>
<updated>2022-03-22T21:11:27+00:00</updated>
<author>
<name>Johan Malm</name>
<email>jgm323@gmail.com</email>
</author>
<published>2022-03-20T20:59:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=11030b73509f698973f81c0cd7b8d6c83598d867'/>
<id>11030b73509f698973f81c0cd7b8d6c83598d867</id>
<content type='text'>
...rather than just the last byte of the password buffer.

Demostrate the need for this by taking the following steps:
- Apply the patch below (before this commit).
- Set keyboard layout to one where utf8 characters longer than one byte
  can be obtained, for example åäö using Swedish layout
  (XKB_DEFAULT_LAYOUT=se).
- Type "åäö" then press backspace and observe that it takes two
  backspaces to delete each character fully, and therefore six
  backspaces to fully clear the password buffer.

diff --git a/password.c b/password.c
index e1a1d9a..b640cd3 100644
--- a/password.c
+++ b/password.c
@@ -29,6 +29,7 @@ void clear_password_buffer(struct swaylock_password *pw) {
 static bool backspace(struct swaylock_password *pw) {
 	if (pw-&gt;len != 0) {
 		pw-&gt;buffer[--pw-&gt;len] = 0;
+		fprintf(stderr, "%s\n", pw-&gt;buffer);
 		return true;
 	}
 	return false;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
...rather than just the last byte of the password buffer.

Demostrate the need for this by taking the following steps:
- Apply the patch below (before this commit).
- Set keyboard layout to one where utf8 characters longer than one byte
  can be obtained, for example åäö using Swedish layout
  (XKB_DEFAULT_LAYOUT=se).
- Type "åäö" then press backspace and observe that it takes two
  backspaces to delete each character fully, and therefore six
  backspaces to fully clear the password buffer.

diff --git a/password.c b/password.c
index e1a1d9a..b640cd3 100644
--- a/password.c
+++ b/password.c
@@ -29,6 +29,7 @@ void clear_password_buffer(struct swaylock_password *pw) {
 static bool backspace(struct swaylock_password *pw) {
 	if (pw-&gt;len != 0) {
 		pw-&gt;buffer[--pw-&gt;len] = 0;
+		fprintf(stderr, "%s\n", pw-&gt;buffer);
 		return true;
 	}
 	return false;
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert swaylock into standalone project</title>
<updated>2019-01-14T02:16:47+00:00</updated>
<author>
<name>Drew DeVault</name>
<email>sir@cmpwn.com</email>
</author>
<published>2019-01-14T02:15:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.prezmop.xyz/swaylock/.git/commit/?id=b90637e2a6e854d586b977ed9b80b806edeb12dd'/>
<id>b90637e2a6e854d586b977ed9b80b806edeb12dd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
