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

Jason Dagit dagit at codersbase.com
Sat Sep 13 01:58:12 UTC 2008


On Fri, Sep 12, 2008 at 10:38 AM, David Roundy <droundy at darcs.net> wrote:
> Here's a fix for a bug that shows up when you try
>
> darcs put remote.server:
>
> And then a refactor to get rid of those Regexes.

Personal style preference here:
+is_url :: String -> Bool
+is_url (':':'/':'/':_) = True
+is_url (_:x) = is_url x
+is_url "" = False

The first case is a little hard for me to read just due to all the
quotes and colons.

is_url :: String -> Bool
is_url "" = False
is_url s = "://" `isPrefixOf` s || is_url (tail s)

Also, will we run into problems if I do:
mkdir :
echo 'hi!' > :/blah
darcs add ://blah

Are there any commands down the road that I could do with the path
"://blah" that are going to fail?

Note: The extra / is there to be intentionally pathological, since
unix will treat that as the same path as ":/blah"

Jason


More information about the darcs-users mailing list