diff --git a/hledger-lib/Hledger/Utils.hs b/hledger-lib/Hledger/Utils.hs index e827149eb..a6066a824 100644 --- a/hledger-lib/Hledger/Utils.hs +++ b/hledger-lib/Hledger/Utils.hs @@ -97,8 +97,11 @@ whitespacechars = " \t\n\r" stripquotes :: String -> String stripquotes s = if isSingleQuoted s || isDoubleQuoted s then init $ tail s else s -isSingleQuoted s = head s == '\'' && last s == '\'' -isDoubleQuoted s = head s == '"' && last s == '"' +isSingleQuoted s@(_:_:_) = head s == '\'' && last s == '\'' +isSingleQuoted _ = False + +isDoubleQuoted s@(_:_:_) = head s == '"' && last s == '"' +isDoubleQuoted _ = False unbracket :: String -> String unbracket s