fix tokenisation operator in strings

This commit is contained in:
VVWVV 2017-10-28 03:18:24 +03:00
parent a65f757a2c
commit 0786aed158

View File

@ -1832,21 +1832,22 @@ static void substallpatterns(unsigned char *line,int buffersize)
} }
#endif #endif
static void doconcat(const char *line) static void ppconcat(const char *line)
{ {
register int i; register const char *c, *p, *b;
const char *p, *b; for (c=line; *c!='\0'; ++c) {
for (i=0; *(line+i)!='\0'; ++i) { if (is_startstring(c))
if (*(line+i)=='#' && *(line+i+1)=='#') { c=skipstring(c);
p=line+i-1; if(*c=='#' && *(c+1)=='#') {
b=line+i+2; p=c-1;
b=c+2;
while (*p==' ') while (*p==' ')
p--; p--;
while (*b==' ') while (*b==' ')
b++; b++;
strcpy((char*)p+1, b); strcpy((char*)p+1,b);
} /* if */ } /* if */
} /* for */ } /* switch */
} }
/* preprocess /* preprocess
@ -1872,14 +1873,14 @@ SC_FUNC void preprocess(void)
stripcom(pline); /* ??? no need for this when reading back from list file (in the second pass) */ stripcom(pline); /* ??? no need for this when reading back from list file (in the second pass) */
lptr=pline; /* set "line pointer" to start of the parsing buffer */ lptr=pline; /* set "line pointer" to start of the parsing buffer */
iscommand=command(); iscommand=command();
doconcat(lptr); ppconcat((char*)lptr);
if (iscommand!=CMD_NONE) if (iscommand!=CMD_NONE)
errorset(sRESET,0); /* reset error flag ("panic mode") on empty line or directive */ errorset(sRESET,0); /* reset error flag ("panic mode") on empty line or directive */
#if !defined NO_DEFINE #if !defined NO_DEFINE
if (iscommand==CMD_NONE) { if (iscommand==CMD_NONE) {
assert(lptr!=term_expr); assert(lptr!=term_expr);
substallpatterns(pline,sLINEMAX); substallpatterns(pline,sLINEMAX);
doconcat(pline); ppconcat((char*)pline);
lptr=pline; /* reset "line pointer" to start of the parsing buffer */ lptr=pline; /* reset "line pointer" to start of the parsing buffer */
} /* if */ } /* if */
#endif #endif