From 62805cb4000f1ce784628d07b114ec8a50de0bc6 Mon Sep 17 00:00:00 2001 From: Y_Less Date: Sat, 30 Jun 2018 16:47:47 +0200 Subject: [PATCH] Redetect error 49, and make `deprecated` auto-insert spaces. --- source/compiler/sc2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/compiler/sc2.c b/source/compiler/sc2.c index fa3fdfe..c726aac 100644 --- a/source/compiler/sc2.c +++ b/source/compiler/sc2.c @@ -417,6 +417,10 @@ static void readline(unsigned char *line) ptr--; /* skip trailing whitespace */ if (*ptr=='\\') { cont=TRUE; + /* set '\a' at the position of '\\' to make it possible to check + * for a line continuation in a single line comment (error 49) + */ + *ptr++='\a'; *ptr='\0'; /* erase '\n' (and any trailing whitespace) */ } /* if */ } /* if */ @@ -920,7 +924,7 @@ static char* strdupwithouta(const char* sourcestring) return NULL; } while ((a=strchr(a,'\a'))!=NULL) { - strcpy(a,a+1); + *a=' '; } return result; }