A couple of weeks ago, Walter Pelissero suggested to consult
user-info:home-dir to set the value of home-directory if $HOME is not
set. This seems to be quite obvious and I was therefore asking myself
why Olin did not implement it like this in the first place.
Are there any objections against applying the following patch for
0.6.1?
Index: scsh.scm
===================================================================
RCS file: /cvsroot/scsh/scsh-0.6/scsh/scsh.scm,v
retrieving revision 1.26
diff -c -r1.26 scsh.scm
*** scsh.scm 2002/01/29 08:12:09 1.26
--- scsh.scm 2002/01/30 16:39:25
***************
*** 963,972 ****
(define (init-scsh-vars quietly?)
(set! home-directory
! (cond ((getenv "HOME") => ensure-file-name-is-nondirectory)
! (else (if (not quietly?)
! (warn "Starting up with no home directory ($HOME)."))
! "/")))
(set-fluid! exec-path-list
(cond ((getenv "PATH") => split-colon-list)
(else (if (not quietly?)
--- 963,982 ----
(define (init-scsh-vars quietly?)
(set! home-directory
! (cond ((getenv "HOME") => ensure-file-name-is-nondirectory)
! ;; loosing at this point would be really bad, so some
! ;; paranoia comes in order
! (else (call-with-current-continuation
! (lambda (k)
! (with-handler
! (lambda (condition more)
! (cond ((not quietly?)
! (display "Starting up with no home directory
($HOME).")
! (newline)))
! (k "/"))
! (lambda ()
! (user-info:home-dir (user-info (user-uid))))))))))
!
(set-fluid! exec-path-list
(cond ((getenv "PATH") => split-colon-list)
(else (if (not quietly?)
--
Martin
|