Tweak prompt-for-password slightly.
authorChris Hanson <org/chris-hanson/cph>
Sun, 9 Apr 1995 23:21:53 +0000 (23:21 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sun, 9 Apr 1995 23:21:53 +0000 (23:21 +0000)
v7/src/edwin/prompt.scm

index aa9181f74d20f2923c0883c07a706fac35249e4f..e52469a41e2749d48e6c362db2f4e22de2be9dc9 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: prompt.scm,v 1.162 1994/03/08 20:28:54 cph Exp $
+;;;    $Id: prompt.scm,v 1.163 1995/04/09 23:21:53 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-94 Massachusetts Institute of Technology
 ;;;
@@ -794,7 +794,10 @@ Whilst editing the command, the following commands are available:
 ;;; in unix.scm which deal with .KY files.
 
 (define (prompt-for-password prompt)
-  (prompt-for-typein prompt false
+  (prompt-for-typein (if (string-suffix? " " prompt)
+                        prompt
+                        (string-append ": " prompt))
+                    #f
     (lambda ()
       (let loop ((ts ""))
        (let ((input (keyboard-read)))
@@ -804,7 +807,7 @@ Whilst editing the command, the following commands are available:
                 (loop ts))
                ((char=? input #\Return)
                 ts)
-               ((char=? input #\C-g)
+               ((or (char=? input #\C-g) (char=? input #\BEL))
                 (abort-current-command))
                ((char=? input #\Rubout)
                 (let ((ts-len (string-length ts)))
@@ -824,5 +827,4 @@ Whilst editing the command, the following commands are available:
     (let ((password2 (prompt-for-password "Verify: ")))
       (if (not (string=? password1 password2))
          (editor-error "Passwords do not match!"))
-      password1)))
-
+      password1)))
\ No newline at end of file