[darcs-devel] darcs patch: fix for bug 463 (with new test)

David Roundy droundy at abridgegame.org
Tue Aug 2 04:34:36 PDT 2005


On Mon, Aug 01, 2005 at 08:39:45PM -0400, Matt Lavin wrote:
> Here's a pretty simple test and fix for bug 463.  I also noticed that 
> bug 194 seems to be fixed but the ticket is still open.
> 
> Mon Aug  1 20:21:16 EDT 2005  Matt Lavin <matt.lavin at gmail.com>
>   * fix for bug 463 (with new test)

Thanks for the bugfix! (and I've now also resolved 194.)

> hunk ./Add.lhs 256
> -             return $ f: map (\f'->f++"/"++f') fs
> +             return $ f: map (\f'-> join f f') fs
> +          where join base ('.':'/':rest) = join base rest
> +                join base dir = base ++ "/" ++ dir 

Note that this is a nice opportunity for the inline syntax:

  return $ f: map (`join` f') fs

Also, this join operator is defined elsewhere, so you could do

import FilePathUtils ( (///) )
...
  return $ f: map (/// f') fs
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list