Zebediah Figura : vbscript: Handle carriage return in more places.

Alexandre Julliard julliard at winehq.org
Fri Aug 23 09:31:24 CDT 2019


Module: wine
Branch: stable
Commit: 2e94bb648f4d0131978b22f7ca63a164f9c32a53
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2e94bb648f4d0131978b22f7ca63a164f9c32a53

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Mon Mar  4 17:14:55 2019 -0600

vbscript: Handle carriage return in more places.

This fixes a regression introduced by 5800c9ed23a5c720843445d91c8547925493df8a.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46772
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 1bd7dbfbc42af85ad5309759d6311427f2860de9)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/vbscript/lex.c       | 9 ++++++---
 dlls/vbscript/tests/run.c | 3 +++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/dlls/vbscript/lex.c b/dlls/vbscript/lex.c
index fa467f0..739f3ac 100644
--- a/dlls/vbscript/lex.c
+++ b/dlls/vbscript/lex.c
@@ -225,7 +225,7 @@ static int parse_string_literal(parser_ctx_t *ctx, const WCHAR **ret)
     int len = 0;
 
     while(ctx->ptr < ctx->end) {
-        if(*ctx->ptr == '\n') {
+        if(*ctx->ptr == '\n' || *ctx->ptr == '\r') {
             FIXME("newline inside string literal\n");
             return 0;
         }
@@ -497,11 +497,14 @@ int parser_lex(void *lval, parser_ctx_t *ctx)
         ret = parse_next_token(lval, ctx);
         if(ret == '_') {
             skip_spaces(ctx);
-            if(*ctx->ptr != '\n') {
+            if(*ctx->ptr != '\n' && *ctx->ptr != '\r') {
                 FIXME("'_' not followed by newline\n");
                 return 0;
             }
-            ctx->ptr++;
+            if(*ctx->ptr == '\r')
+                ctx->ptr++;
+            if(*ctx->ptr == '\n')
+                ctx->ptr++;
             continue;
         }
         if(ret != tNL || ctx->last_token != tNL)
diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c
index 103082f..7f1fd4c 100644
--- a/dlls/vbscript/tests/run.c
+++ b/dlls/vbscript/tests/run.c
@@ -2476,6 +2476,9 @@ static void run_tests(void)
     SET_EXPECT(global_success_d);
     SET_EXPECT(global_success_i);
     parse_script_a("' comment\r"
+                   "x = _\r3\r"
+                   "x = _\n3\r"
+                   "x = _\r\n3\r"
                    "Sub testsub(arg)\r"
                    "If arg = 1 Then\r\r"
                    "Call reportSuccess()\n\n"




More information about the wine-cvs mailing list