From a20584b47db98068c1de9ac7f3a96192dcb07adf Mon Sep 17 00:00:00 2001
From: Slava Pestov <slava@factorcode.org>
Date: Mon, 12 Nov 2007 17:00:32 -0500
Subject: [PATCH] Fix parent-directory

---
 core/io/files/files.factor | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/io/files/files.factor b/core/io/files/files.factor
index efa9096791..c4aac6d4a2 100755
--- a/core/io/files/files.factor
+++ b/core/io/files/files.factor
@@ -67,11 +67,11 @@ TUPLE: no-parent-directory path ;
 : parent-directory ( path -- parent )
     trim-path-separators
     dup root-directory? [ ] [
-        dup last-path-separator drop [
+        dup last-path-separator drop dup [
             1+ cut
             special-directory?
             [ no-parent-directory ] when
-        ] when*
+        ] [ 2drop "." ] if
     ] if ;
 
 : file-name ( path -- string )