From 0cb0c61fcbbdf7be644824663ed4ee27079670c4 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sun, 14 Aug 2011 22:38:51 +0000 Subject: [PATCH] fix partial isSingleQuoted/isDoubleQuoted functions --- hledger-lib/Hledger/Utils.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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