diff --git a/src/ShellCheck/Checks/ShellSupport.hs b/src/ShellCheck/Checks/ShellSupport.hs index 924b002..83d7887 100644 --- a/src/ShellCheck/Checks/ShellSupport.hs +++ b/src/ShellCheck/Checks/ShellSupport.hs @@ -456,11 +456,10 @@ checkEchoSed = ForShell [Bash, Ksh] f -- This should have used backreferences, but TDFA doesn't support them sedRe = mkRegex "^s(.)([^\n]*)g?$" - isSimpleSed s = fromMaybe False $ do + isSimpleSed s = isJust $ do [h:_,rest] <- matchRegex sedRe s let delimiters = filter (== h) rest guard $ length delimiters == 2 - return True checkIn id s = when (isSimpleSed s) $ style id 2001 "See if you can use ${variable//search/replace} instead."