Changeset 15118 in project for chicken


Ignore:
Timestamp:
06/30/09 10:26:47 (10 years ago)
Author:
felix winkelmann
Message:

fixed tilde-expansion (reported by Zbigniew), ~user isn't supported anymore (and never was officially)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/library.scm

    r15047 r15118  
    18461846
    18471847(define ##sys#expand-home-path
    1848   (let ((getenv getenv))
     1848  (let ((get-environment-variable get-environment-variable))
    18491849    (lambda (path)
    18501850      (let ((len (##sys#size path)))
     
    18531853              ((#\~)
    18541854               (let ((rest (##sys#substring path 1 len)))
    1855                  (if (and (fx> len 1) (char=? #\/ (##core#inline "C_subchar" path 1)))
    1856                      (##sys#string-append (or (getenv "HOME") "") rest)
    1857                      (##sys#string-append "/home/" rest) ) ) )
     1855                 (##sys#string-append (or (getenv "HOME") "") rest) ) )
    18581856              ((#\$)
    18591857               (let loop ((i 1))
     
    18631861                       (if (or (eq? c #\/) (eq? c #\\))
    18641862                           (##sys#string-append
    1865                             (or (getenv (##sys#substring path 1 i)) "")
     1863                            (or (get-environment-variable (##sys#substring path 1 i)) "")
    18661864                            (##sys#substring path i len))
    18671865                           (loop (fx+ i 1)) ) ) ) ) )
Note: See TracChangeset for help on using the changeset viewer.