mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 05:21:34 -07:00
Fixed crash for ''foo due to unsafe 'last'
This commit is contained in:
parent
652f8a24fa
commit
651bab73de
1 changed files with 1 additions and 1 deletions
|
@ -644,7 +644,7 @@ readSingleQuoted = called "single quoted string" $ do
|
||||||
let string = concat s
|
let string = concat s
|
||||||
return (T_SingleQuoted id string) `attempting` do
|
return (T_SingleQuoted id string) `attempting` do
|
||||||
x <- lookAhead anyChar
|
x <- lookAhead anyChar
|
||||||
when (isAlpha x && isAlpha (last string)) $ parseProblemAt pos WarningC "This apostrophe terminated the single quoted string!"
|
when (isAlpha x && not (null string) && isAlpha (last string)) $ parseProblemAt pos WarningC "This apostrophe terminated the single quoted string!"
|
||||||
|
|
||||||
readSingleQuotedLiteral = do
|
readSingleQuotedLiteral = do
|
||||||
singleQuote
|
singleQuote
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue