All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Kourt <tim.a.kourt@linux.intel.com>
To: iwd@lists.01.org
Subject: [PATCH 2/2] client: Update rl_point to last known position
Date: Tue, 29 Oct 2019 15:33:09 -0700	[thread overview]
Message-ID: <20191029223309.25581-2-tim.a.kourt@linux.intel.com> (raw)
In-Reply-To: <20191029223309.25581-1-tim.a.kourt@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 632 bytes --]

Keep cursor's position consistent when passphrase is reaching
its maximum by adding characters in the middle of the string

This isn't practical behavior.
---
 client/display.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/client/display.c b/client/display.c
index 74b50e2e..fc280d31 100644
--- a/client/display.c
+++ b/client/display.c
@@ -408,7 +408,9 @@ static void mask_input(void)
 		return;
 
 	if (rl_end > MAX_PASSPHRASE_LEN) {
-		rl_point = rl_end = MAX_PASSPHRASE_LEN;
+		rl_end = MAX_PASSPHRASE_LEN;
+		rl_point = masked_input.point;
+
 		goto set_mask;
 	}
 
-- 
2.13.6

      reply	other threads:[~2019-10-29 22:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29 22:33 [PATCH 1/2] client: Increase passphrase buffer to accommodate for nil byte Tim Kourt
2019-10-29 22:33 ` Tim Kourt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191029223309.25581-2-tim.a.kourt@linux.intel.com \
    --to=tim.a.kourt@linux.intel.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.