From 3db7ce2b91dbf85c05d064e9a7cee9e04b84409a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Sep 2012 21:47:19 +0200 Subject: [PATCH] handle windows line endings in the qtdeclarative/js processor apparently the parser does not do that any more, so do it here. Change-Id: Idd7259ba1435f14be2be5afafa40689a05ab62af Reviewed-by: Oswald Buddenhagen --- src/linguist/lupdate/qdeclarative.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linguist/lupdate/qdeclarative.cpp b/src/linguist/lupdate/qdeclarative.cpp index 275dd04..7ab81d5 100644 --- a/src/linguist/lupdate/qdeclarative.cpp +++ b/src/linguist/lupdate/qdeclarative.cpp @@ -383,7 +383,7 @@ void FindTrCalls::processComment(const AST::SourceLocation &loc) if (p >= length) goto whoops; c = chars[p++].unicode(); - if (c == '\n') + if (c == '\r' || c == '\n') goto whoops; *ptr++ = '\\'; } @@ -394,7 +394,7 @@ void FindTrCalls::processComment(const AST::SourceLocation &loc) } else { int idx = 0; ushort c; - while ((c = chars[idx].unicode()) == ' ' || c == '\t' || c == '\n') + while ((c = chars[idx].unicode()) == ' ' || c == '\t' || c == '\r' || c == '\n') ++idx; if (!memcmp(chars + idx, MagicComment.unicode(), MagicComment.length() * 2)) { idx += MagicComment.length(); -- 2.7.4