Version française
Home     About     Download     Resources     Contact us    
Browse thread
Bug in Filename.basename?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Erik de Castro Lopo <mle+ocaml@m...>
Subject: Bug in Filename.basename?
Hi all,

I think I have found a bug in the above function.
        Objective Caml version 3.10.0

    # let x = Filename.basename "a/b/c" ;;
    val x : string = "c"
    # let x = Filename.basename "a/b/c/" ;;
    val x : string = "."

The first result is fine, but second result is definitely not what
one would reasonably expect.

For instance, the basename program in Linux gives:

    > basename a/b/c/
    c

Erik

-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"C++ is a language strongly optimized for liars and people who
go by guesswork and ignorance." -- Erik Naggum