[darcs-users] darcs patch: change is_file to return false on dround... (and 1 more)

David Roundy droundy at darcs.net
Sat Sep 13 10:45:59 UTC 2008


On Fri, Sep 12, 2008 at 11:09:17PM +0100, Eric Kow wrote:
> > -match_not_file = mkRegex "..+:"
> > -is_file fou = isNothing $ matchRegex match_not_file fou
> > +is_file :: String -> Bool
> > +is_file (_:_:fou) = ':' `notElem` fou
> > +is_file _ = True
> 
> Indeed, this does appear to be unchanged.
> 
> I was wondering for a while why we seem to assume that hostnames are at
> least two letters long, but then it struck me that this must be because
> we want to recognise Windows drive names (e.g. C:) as being such.  IF
> so, this is exactly the kind of thing we ought to haddock.

It's in the comment in the file.  You can haddock   if you like.

> > -match_url = mkRegex ".+://.+"
> > +is_url :: String -> Bool
> > +is_url (':':'/':'/':_) = True
> > +is_url (_:x) = is_url x
> > +is_url "" = False
> 
> It looks like there is a small change in this function.
> 
> Before, we rejected
>   foo://
> because it was missing a character at the end.  Now we accept it.
> 
> I'm guessing this doesn't really matter, but just in case, I am
> going to wait until you comment before pushing into stable.

You're right, it shouldn't  matter, but it's best  to not  make a change.
I'm pushing an additional fix.


Thanks for the review!

David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20080913/00c86c55/attachment.pgp 


More information about the darcs-users mailing list