From 71751f314469e6cba50f1f22492a2cb0b7ffe5ac Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Sat, 29 Dec 2018 16:36:24 +0800 Subject: [PATCH] Fix off-by-one in overlap check for fixes Previously if we have 2 ranges like: start: 6, end: 6 start: 6, end: 6 they would not be considered as overlap Fixes #1431 --- src/ShellCheck/Fixer.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ShellCheck/Fixer.hs b/src/ShellCheck/Fixer.hs index 78abfeb..2a96f79 100644 --- a/src/ShellCheck/Fixer.hs +++ b/src/ShellCheck/Fixer.hs @@ -10,7 +10,7 @@ class Ranged a where end :: a -> Position overlap :: a -> a -> Bool overlap x y = - (yStart >= xStart && yStart < xEnd) || (yStart < xStart && yEnd > xStart) + (yStart >= xStart && yStart <= xEnd) || (yStart < xStart && yEnd > xStart) where yStart = start y yEnd = end y