[darcs patch] filepath: normalise trailing dot

Conrad Parker conrad at metadecks.org
Thu Feb 11 03:22:58 EST 2010


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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: normalise-trailing-dot.patch
Type: text/x-diff
Size: 3694 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/libraries/attachments/20100211/31e22a23/normalise-trailing-dot.bin

More information about the Libraries mailing list