[darcs-users] darcs patch: Make --token-chars [^ \t\n] work as advertised.

Trent W. Buck trentbuck at gmail.com
Thu Mar 19 00:42:58 UTC 2009


Eric Kow <kowey at darcs.net> writes:
> Make --token-chars [^ \t\n] work as advertised.
> -----------------------------------------------
>> Trent W. Buck <trentbuck at gmail.com>**20090318023019
>>  Ignore-this: dfda7e1c8bcbd03cca26e5a473d50b6f
>> ] hunk ./src/Darcs/Commands/Replace.lhs 199
>>  
>>  choose_toks :: [DarcsFlag] -> String -> String -> IO String
>>  choose_toks (Toks t:_) a b
>> -    | any isSpace t = fail $ bad_token_spec $ "Space is not allowed in the spec"
>> +    | any isSpace t && '^' /= head t
>> +        = fail $ bad_token_spec $ "Space is not allowed in the spec"
>
> Style police: "head t" is liable to blow up if t is null.

Good point.  I need to spend more time on this patch, I'll try to do so
this weekend.  The logic is wrong above anyway, as you noticed, because
of the stupid surrounding brackets.



More information about the darcs-users mailing list