This commit is contained in:
Joey Hess 2011-12-09 01:57:13 -04:00
parent e3f1568e0f
commit d64132a43a
16 changed files with 25 additions and 29 deletions

View file

@ -55,15 +55,15 @@ fixBadUUID = M.fromList . map fixup . M.toList
| otherwise = (k, v)
where
kuuid = fromUUID k
isbad = (not $ isuuid kuuid) && isuuid lastword
isbad = not (isuuid kuuid) && isuuid lastword
ws = words $ value v
lastword = last ws
fixeduuid = toUUID lastword
fixedvalue = unwords $ kuuid:(take (length ws - 1) ws)
fixedvalue = unwords $ kuuid: init ws
-- For the fixed line to take precidence, it should be
-- slightly newer, but only slightly.
newertime (LogEntry (Date d) _) = d + minimumPOSIXTimeSlice
newertime (LogEntry (Unknown) _) = minimumPOSIXTimeSlice
newertime (LogEntry Unknown _) = minimumPOSIXTimeSlice
minimumPOSIXTimeSlice = 0.000001
isuuid s = length s == 36 && length (split "-" s) == 5