diff options
| author | Richard M. Stallman | 1996-10-08 23:00:54 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-10-08 23:00:54 +0000 |
| commit | dc81e1664f0d89beb046242a896912b3fc9bee37 (patch) | |
| tree | 26b1e8ae4e315d63659f7345c9d7842e8c7cb59b | |
| parent | 0565d3079ac6c86a0680d533f4dbe70df86d5597 (diff) | |
| download | emacs-dc81e1664f0d89beb046242a896912b3fc9bee37.tar.gz emacs-dc81e1664f0d89beb046242a896912b3fc9bee37.zip | |
(comint-read-noecho): Clear out the intermediate strings.
| -rw-r--r-- | lisp/comint.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index ae427e48dac..91cf20d550b 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -1396,9 +1396,11 @@ RET, LFD, or ESC. DEL or C-h rubs out. C-u kills line. C-g aborts (if | |||
| 1396 | filter and C-g is pressed, this function returns nil rather than a string). | 1396 | filter and C-g is pressed, this function returns nil rather than a string). |
| 1397 | 1397 | ||
| 1398 | Note that the keystrokes comprising the text can still be recovered | 1398 | Note that the keystrokes comprising the text can still be recovered |
| 1399 | \(temporarily) with \\[view-lossage]. This may be a security bug for some | 1399 | \(temporarily) with \\[view-lossage]. Some people find this worrysome. |
| 1400 | applications." | 1400 | Once the caller uses the password, it can erase the password |
| 1401 | by doing (fillarray STRING 0)." | ||
| 1401 | (let ((ans "") | 1402 | (let ((ans "") |
| 1403 | (newans nil) | ||
| 1402 | (c 0) | 1404 | (c 0) |
| 1403 | (echo-keystrokes 0) | 1405 | (echo-keystrokes 0) |
| 1404 | (cursor-in-echo-area t) | 1406 | (cursor-in-echo-area t) |
| @@ -1423,10 +1425,14 @@ applications." | |||
| 1423 | ((or (= c ?\r) (= c ?\n) (= c ?\e)) | 1425 | ((or (= c ?\r) (= c ?\n) (= c ?\e)) |
| 1424 | (setq done t)) | 1426 | (setq done t)) |
| 1425 | ((= c ?\C-u) | 1427 | ((= c ?\C-u) |
| 1428 | (fillarray ans 0) | ||
| 1426 | (setq ans "")) | 1429 | (setq ans "")) |
| 1427 | ((and (/= c ?\b) (/= c ?\177)) | 1430 | ((and (/= c ?\b) (/= c ?\177)) |
| 1428 | (setq ans (concat ans (char-to-string c)))) | 1431 | (setq newans (concat ans (char-to-string c))) |
| 1432 | (fillarray ans 0) | ||
| 1433 | (setq ans newans)) | ||
| 1429 | ((> (length ans) 0) | 1434 | ((> (length ans) 0) |
| 1435 | (aset ans (1- (length ans)) 0) | ||
| 1430 | (setq ans (substring ans 0 -1))))) | 1436 | (setq ans (substring ans 0 -1))))) |
| 1431 | (if quit-flag | 1437 | (if quit-flag |
| 1432 | ;; Emulate a true quit, except that we have to return a value. | 1438 | ;; Emulate a true quit, except that we have to return a value. |