From 2fad1de0e4810a2eb95f665fed11ec5846bb25a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Tue, 6 Jun 2000 15:51:55 -0700 Subject: [PATCH] bugfix for CRNL in preprocessor Rev: src/cpp.c:1.64 Rev: src/testsuite.in:1.297 --- src/cpp.c | 14 +++++++++++++- src/testsuite.in | 20 +++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/cpp.c b/src/cpp.c index 16efd5e53b..43f6d312d0 100644 --- a/src/cpp.c +++ b/src/cpp.c @@ -5,7 +5,7 @@ \*/ /* - * $Id: cpp.c,v 1.63 2000/05/11 14:09:45 grubba Exp $ + * $Id: cpp.c,v 1.64 2000/06/06 22:51:55 hubbe Exp $ */ #include "global.h" #include "stralloc.h" @@ -340,6 +340,11 @@ while(1) \ pos++; \ continue; \ } \ + if(data[pos+1]=='\r' && data[pos+2]=='\n') \ + { \ + pos+=2; \ + continue; \ + } \ READCHAR(tmp); \ string_builder_putchar(&nf, tmp); \ continue; \ @@ -382,6 +387,13 @@ while(1) \ this->current_line++; \ continue; \ } \ + if(data[pos]=='\r' && data[pos+1]=='\n') \ + { \ + pos+=2; \ + trailing_newlines++; \ + this->current_line++; \ + continue; \ + } \ if(outp) string_builder_putchar(&nf, '\\'); \ pos++; \ \ diff --git a/src/testsuite.in b/src/testsuite.in index f6b1ce1fc8..4546277052 100644 --- a/src/testsuite.in +++ b/src/testsuite.in @@ -1,4 +1,4 @@ -test_true([["$Id: testsuite.in,v 1.296 2000/05/25 17:20:58 grubba Exp $"]]); +test_true([["$Id: testsuite.in,v 1.297 2000/06/06 22:51:55 hubbe Exp $"]]); cond([[all_constants()->_verify_internals]], [[ @@ -2964,6 +2964,24 @@ test_any([[ return FOOa(2); ]],2) +test_any([[ +#define FOOa(X) \ +(X) +return FOOa(3); +]],3) + +test_any([[ +#define FOOa(X) "bar\ +gazonk" +return FOOa(3); +]],"bargazonk") + +test_any([[ +#define FOOa(X) "bar\ +gazonk" +return FOOa(3); +]],"bargazonk") + // /* */ test_any([[ -- GitLab