diff options
Diffstat (limited to 'lualibs-util-prs.lua')
-rw-r--r-- | lualibs-util-prs.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lualibs-util-prs.lua b/lualibs-util-prs.lua index 29a57e0..e5b35a7 100644 --- a/lualibs-util-prs.lua +++ b/lualibs-util-prs.lua @@ -184,8 +184,10 @@ function parsers.settings_to_array(str,strict) else return { str } end - else + elseif find(str,",") then return lpegmatch(pattern,str) + else + return { str } end end @@ -483,8 +485,8 @@ function parsers.rfc4180splitter(specification) * Cs((dquotechar + (1 - quotechar))^0) * quotechar local non_escaped = C((1 - quotechar - newline - separator)^1) - local field = escaped + non_escaped - local record = Ct((field * separator^-1)^1) + local field = escaped + non_escaped + Cc("") + local record = Ct(field * (separator * field)^1) local headerline = record * Cp() local wholeblob = Ct((newline^-1 * record)^0) return function(data,getheader) |