mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-07 20:23:03 +08:00
Fixed crash for ''foo due to unsafe 'last'
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user