Mercurial > emacs
comparison lisp/subr.el @ 52132:4127c72e350b
(read-passwd): Use clear-string instead of fillarray.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 06 Aug 2003 01:05:15 +0000 |
parents | 9e88997e86c3 |
children | 541533296a1d |
comparison
equal
deleted
inserted
replaced
52131:6be32b5661a6 | 52132:4127c72e350b |
---|---|
1178 (while (not success) | 1178 (while (not success) |
1179 (let ((first (read-passwd prompt nil default)) | 1179 (let ((first (read-passwd prompt nil default)) |
1180 (second (read-passwd "Confirm password: " nil default))) | 1180 (second (read-passwd "Confirm password: " nil default))) |
1181 (if (equal first second) | 1181 (if (equal first second) |
1182 (progn | 1182 (progn |
1183 (and (arrayp second) (fillarray second ?\0)) | 1183 (and (arrayp second) (clear-string second)) |
1184 (setq success first)) | 1184 (setq success first)) |
1185 (and (arrayp first) (fillarray first ?\0)) | 1185 (and (arrayp first) (clear-string first)) |
1186 (and (arrayp second) (fillarray second ?\0)) | 1186 (and (arrayp second) (clear-string second)) |
1187 (message "Password not repeated accurately; please start over") | 1187 (message "Password not repeated accurately; please start over") |
1188 (sit-for 1)))) | 1188 (sit-for 1)))) |
1189 success) | 1189 success) |
1190 (let ((pass nil) | 1190 (let ((pass nil) |
1191 (c 0) | 1191 (c 0) |
1197 (setq c (read-char-exclusive nil t)) | 1197 (setq c (read-char-exclusive nil t)) |
1198 (and (/= c ?\r) (/= c ?\n) (/= c ?\e))) | 1198 (and (/= c ?\r) (/= c ?\n) (/= c ?\e))) |
1199 (clear-this-command-keys) | 1199 (clear-this-command-keys) |
1200 (if (= c ?\C-u) | 1200 (if (= c ?\C-u) |
1201 (progn | 1201 (progn |
1202 (and (arrayp pass) (fillarray pass ?\0)) | 1202 (and (arrayp pass) (clear-string pass)) |
1203 (setq pass "")) | 1203 (setq pass "")) |
1204 (if (and (/= c ?\b) (/= c ?\177)) | 1204 (if (and (/= c ?\b) (/= c ?\177)) |
1205 (let* ((new-char (char-to-string c)) | 1205 (let* ((new-char (char-to-string c)) |
1206 (new-pass (concat pass new-char))) | 1206 (new-pass (concat pass new-char))) |
1207 (and (arrayp pass) (fillarray pass ?\0)) | 1207 (and (arrayp pass) (clear-string pass)) |
1208 (fillarray new-char ?\0) | 1208 (clear-string new-char) |
1209 (setq c ?\0) | 1209 (setq c ?\0) |
1210 (setq pass new-pass)) | 1210 (setq pass new-pass)) |
1211 (if (> (length pass) 0) | 1211 (if (> (length pass) 0) |
1212 (let ((new-pass (substring pass 0 -1))) | 1212 (let ((new-pass (substring pass 0 -1))) |
1213 (and (arrayp pass) (fillarray pass ?\0)) | 1213 (and (arrayp pass) (clear-string pass)) |
1214 (setq pass new-pass)))))) | 1214 (setq pass new-pass)))))) |
1215 (message nil) | 1215 (message nil) |
1216 (or pass default "")))) | 1216 (or pass default "")))) |
1217 | 1217 |
1218 ;;; Atomic change groups. | 1218 ;;; Atomic change groups. |