ssadler / hawk

Awk for Hoodlums
BSD 3-Clause "New" or "Revised" License
35 stars 2 forks source link

Crash if prelude.hs contains only whitespace #41

Closed gelisam closed 11 years ago

gelisam commented 11 years ago

Hawk crashes if ~/.hawk/prelude.hs is empty or contains only newlines:

> touch ~/.hawk/prelude.hs
> cat ~/.hawk/prelude.hs
> hawk -e [1..3]
hawk: Data.ByteString.head: empty ByteString
> printf "\n\n\n" > ~/.hawk/prelude.hs
> cat ~/.hawk/prelude.hs

> hawk -e [1..3]
hawk: Data.ByteString.head: empty ByteString
melrief commented 11 years ago

Using head on an empty string, that's a noob error :(. It should work now. Note that I merged the branch config_with_prelude in merge, so you can pull directly that branch.