Conrad Parker | 1 Dec 05:59 2010

Re: [darcs patch] filepath: normalise trailing dot

Hi,

I've re-opened ticket #3975 related to this proposal.

It's a fairly minor patch which ensures that filepaths containing a
trailing dot are normalised consistently, ie. the path "foo/bar/." is
normalised to "foo/bar"

Discussion period: 2 weeks

cheers,

Conrad.

On 11 April 2010 10:08, Conrad Parker <conrad <at> metadecks.org> wrote:
> On 17 February 2010 01:50, Neil Mitchell <ndmitchell <at> gmail.com> wrote:
>> Hi Conrad,
>>
>> Your proposal seems sensible (+1). Although in the past some people
>> complained about normalising away .'s being a bug in some corner
>> cases, so if anyone can find one of them I withdraw my support.
>>
>> Creating a trac ticket is important so that the patch doesn't get lost.
>
> Hi,
>
> apologies for the high latency, here is a trac ticket:
>
> http://hackage.haskell.org/trac/ghc/ticket/3975
>
> Conrad.
>
>>
>> Thanks, Neil
>>
>> On Thu, Feb 11, 2010 at 8:22 AM, Conrad Parker <conrad <at> metadecks.org> wrote:
>>> Hi,
>>>
>>> the attached darcs patch modifies the behaviour of normalise to handle
>>> trailing dots in a path. The previous behaviour yielded this:
>>>
>>> Prelude System.FilePath> normalise "../."
>>> "../."
>>> Prelude System.FilePath> normalise ".././"
>>> ".././"
>>> Prelude System.FilePath> normalise ".././.."
>>> "../.."
>>>
>>> This patch modifies dropDots such that the check for (".":[]) only
>>> occurs once for the path, after which a driver function dropDots' is
>>> used which skips this check. Hence "." can be removed from the end of
>>> a longer path, but a path of just "." is unchanged.
>>>
>>> (my trac account is pending verification, I'll reply with a trac
>>> ticket # later if needed)
>>>
>>> cheers,
>>>
>>> Conrad.
>>>
>>> _______________________________________________
>>> Libraries mailing list
>>> Libraries <at> haskell.org
>>> http://www.haskell.org/mailman/listinfo/libraries
>>>
>>>
>>
>>
>

Gmane