Fix parent-directory on /

release
Slava Pestov 2007-11-12 01:56:40 -05:00
parent a74bf88d9e
commit 6f19e210b3
1 changed files with 8 additions and 6 deletions

View File

@ -66,12 +66,14 @@ TUPLE: no-parent-directory path ;
: parent-directory ( path -- parent ) : parent-directory ( path -- parent )
trim-path-separators trim-path-separators
dup empty? [ drop "/" ] [
dup root-directory? [ ] [ dup root-directory? [ ] [
dup last-path-separator drop [ dup last-path-separator drop [
1+ cut 1+ cut
special-directory? special-directory?
[ no-parent-directory ] when [ no-parent-directory ] when
] when* ] when*
] if
] if ; ] if ;
: file-name ( path -- string ) : file-name ( path -- string )