summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-01-23 17:12:52 +1100
committerJed Barber <jjbarber@y7mail.com>2017-01-23 17:12:52 +1100
commita65a1ba67d1e8a7f91101da8d1c8ae4497089a60 (patch)
tree516e59177000391b6421ab9a2235463dc6ba5043 /src
parent8001d0fda7de000530d2c71fe8d507006036eccd (diff)
Potential preference data parsing bug with end of line characters fixed
Diffstat (limited to 'src')
-rw-r--r--src/Counter.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Counter.hs b/src/Counter.hs
index 317f96a..37b36dc 100644
--- a/src/Counter.hs
+++ b/src/Counter.hs
@@ -45,7 +45,7 @@ createSenateCounter f a b = do
h <- IO.openFile f IO.ReadMode
let readFunc n p = if (n > numLines) then return p else do
t0 <- IO.hGetLine h
- let t1 = CSV.parseRecord CSV.defaultSettings t0
+ let t1 = CSV.parseRecord CSV.defaultSettings (t0 ++ "\n")
t2 = Maybe.listToMaybe . reverse . Either.fromRight $ t1
t3 = Pref.parsePreferences (length a) (length b) (Maybe.fromJust t2)
t4 = Pref.normalise a b (Either.fromRight t3)