mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 22:35:54 +08:00
Make it slightly lazier still (and more clear)
This commit is contained in:
@@ -968,7 +968,7 @@ checkCatastrophicRm = CommandCheck (Basename "rm") $ \t ->
|
|||||||
stripTrailing c = reverse . dropWhile (== c) . reverse
|
stripTrailing c = reverse . dropWhile (== c) . reverse
|
||||||
skipRepeating c = foldr go []
|
skipRepeating c = foldr go []
|
||||||
where
|
where
|
||||||
go a r = a : if a == c then case r of b:rest | b == c -> rest; _ -> r else r
|
go a r = a : case r of b:rest | b == c && a == b -> rest; _ -> r
|
||||||
|
|
||||||
paths = [
|
paths = [
|
||||||
"", "/bin", "/etc", "/home", "/mnt", "/usr", "/usr/share", "/usr/local",
|
"", "/bin", "/etc", "/home", "/mnt", "/usr", "/usr/share", "/usr/local",
|
||||||
|
Reference in New Issue
Block a user