From: Chris Hanson Date: Tue, 4 May 1999 17:47:49 +0000 (+0000) Subject: Interpret contents of password-file variable as relative to the user's X-Git-Tag: 20090517-FFI~4554 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4f372b4a25ec4cb979cb90f3ce2bc197cfdd5753;p=mit-scheme.git Interpret contents of password-file variable as relative to the user's home directory. --- diff --git a/v7/src/edwin/loadef.scm b/v7/src/edwin/loadef.scm index 719d72374..fe1b00cdf 100644 --- a/v7/src/edwin/loadef.scm +++ b/v7/src/edwin/loadef.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: loadef.scm,v 1.39 1999/05/04 17:23:04 cph Exp $ +;;; $Id: loadef.scm,v 1.40 1999/05/04 17:47:49 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology ;;; @@ -324,6 +324,7 @@ If password-file is #f, or if prefix arg supplied, prompts for a filename.") (define-variable password-file "Name of file containing passwords, or #F meaning prompt for name. +If this specifies a relative pathname, it is relative to the home directory. See \\[view-password-file]." #f (lambda (object) diff --git a/v7/src/edwin/pwedit.scm b/v7/src/edwin/pwedit.scm index a7e37ba63..7ab5f69e9 100644 --- a/v7/src/edwin/pwedit.scm +++ b/v7/src/edwin/pwedit.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: pwedit.scm,v 1.6 1999/05/04 17:41:20 cph Exp $ +;;; $Id: pwedit.scm,v 1.7 1999/05/04 17:47:16 cph Exp $ ;;; ;;; Copyright (c) 1999 Massachusetts Institute of Technology ;;; @@ -35,11 +35,16 @@ Reads the file specified in the variable password-file. If password-file is #f, or if prefix arg supplied, prompts for a filename." (lambda () (list - (let ((filename (ref-variable password-file))) - (if (and filename (not (command-argument))) - filename - (prompt-for-existing-file "View password file" - (and filename (list filename))))))) + (let ((pathname + (let ((filename (ref-variable password-file))) + (and filename + (merge-pathnames filename (user-homedir-pathname))))) + (prompt + (lambda (default) + (prompt-for-existing-file "View password file" default)))) + (cond ((not pathname) (prompt #f)) + ((command-argument) (prompt (list pathname))) + (else pathname))))) (lambda (pathname) (let ((forms (call-with-temporary-buffer " view-pw-file"