 
 : parent-directory ( path -- parent )
     dup root-directory? [
-        right-trim-separators
+        trim-right-separators
         dup last-path-separator [
             1+ cut
         ] [

HOOK: make-directory io-backend ( path -- )

: make-directories ( path -- )
    normalize-path right-trim-separators {
        { [ dup "." = ] [ ] }
        { [ dup root-directory? ] [ ] }
        { [ dup empty? ] [ ] }

: append-path-empty ( path1 path2 -- path' )
    {
        { [ dup head.? ] [
            rest trim-left-separators append-path-empty
        ] }
        { [ dup head..? ] [ drop no-parent-directory ] }
        [ nip ]
