Skip to content
Browse files

parseLine: switch Host4/6 detection for robustness

  • Loading branch information...
1 parent 6092bd4 commit 5458b23dde366fbcc621018cc1a2f5424671efc4 @astro astro committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 pentalog.hs
View
6 pentalog.hs
@@ -95,10 +95,10 @@ parseLine = {-# SCC "getResult" #-} getResult . {-# SCC "parse" #-} parse line
num = (maybe 0 fst . SC.readInteger) `liftM` takeWhile (isDigit . w2c)
num' = (maybe 0 fst . SC.readInt) `liftM` takeWhile (isDigit . w2c)
host = do h <- SC.unpack `liftM` word
- case '.' `elem` h of
- True ->
- return $ Host4 $ readAddress h
+ case ':' `elem` h of
False ->
+ return $ Host4 $ readAddress h
+ True ->
return $ Host6 $ readAddress h
date = do day <- num'

0 comments on commit 5458b23

Please sign in to comment.
Something went wrong with that request. Please try again.