[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#22027: 25.1.50; Return uncorrupted default string
From: |
npostavs |
Subject: |
bug#22027: 25.1.50; Return uncorrupted default string |
Date: |
Sat, 03 Jun 2017 23:51:13 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) |
Tino Calancha <f92capac@gmail.com> writes:
> + (setq success (copy-sequence first))
> + (when (and (arrayp first)
> + (not (string= first "")))
> + (clear-string first)
> + (clear-string second)))
I think that is too complicated, how about this instead:
>From 739ab77ca99a57f10088aa8a9f2c079c1727a071 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Sat, 3 Jun 2017 23:41:53 -0400
Subject: [PATCH v1] * lisp/subr.el (read-passwd): Don't delete return value
(Bug#22027).
---
lisp/subr.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/subr.el b/lisp/subr.el
index 9b3e53b70b..76c13a8d23 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2268,7 +2268,7 @@ (defun read-passwd (prompt &optional confirm default)
(second (read-passwd "Confirm password: " nil default)))
(if (equal first second)
(progn
- (and (arrayp second) (clear-string second))
+ (and (arrayp second) (not (eq first second)) (clear-string
second))
(setq success first))
(and (arrayp first) (clear-string first))
(and (arrayp second) (clear-string second))
--
2.11.1
- bug#22027: 25.1.50; Return uncorrupted default string,
npostavs <=