From 1f6cd994085fa4f226d0ee13b8d42687462e9e1c Mon Sep 17 00:00:00 2001 From: ac-stef Date: Sat, 18 Apr 2015 14:07:45 +0200 Subject: [PATCH] fix CR-handling for looplist --- source/src/command.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/src/command.cpp b/source/src/command.cpp index 63b53271..c042c901 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -1132,7 +1132,7 @@ void format(char **args, int numargs) } #define whitespaceskip do { s += strspn(s, "\n\t \r"); } while(s[0] == '/' && s[1] == '/' && (s += strcspn(s, "\n\0"))) -#define elementskip { if(*s=='"') { do { ++s; s += strcspn(s, "\"\n"); } while(*s == '\"' && s[-1] == '\\'); s += *s=='"'; } else s += strcspn(s, "\n\t "); } +#define elementskip { if(*s=='"') { do { ++s; s += strcspn(s, "\"\n"); } while(*s == '\"' && s[-1] == '\\'); s += *s=='"'; } else s += strcspn(s, "\r\n\t "); } void explodelist(const char *s, vector &elems) { @@ -1462,6 +1462,7 @@ const char *escapestring(const char *s, bool force, bool noquotes) for(; *s; s++) switch(*s) { case '\n': buf.put("\\n", 2); break; + case '\r': buf.put("\\n", 2); break; case '\t': buf.put("\\t", 2); break; case '\f': buf.put("\\f", 2); break; case '"': buf.put("\\\"", 2); break;