Don't delete trailing whitespace before '\'
new s [] = "hello \ world"; ^ needs to be "hello world", not "helloworld".
This commit is contained in:
parent
36d5eed854
commit
693591bdc3
@ -417,12 +417,9 @@ static void readline(unsigned char *line)
|
|||||||
ptr--; /* skip trailing whitespace */
|
ptr--; /* skip trailing whitespace */
|
||||||
if (*ptr=='\\') {
|
if (*ptr=='\\') {
|
||||||
cont=TRUE;
|
cont=TRUE;
|
||||||
while (*(ptr-1)<=' ' && *(ptr-1)!='\0')
|
|
||||||
ptr--;
|
|
||||||
/* set '\a' at the position of '\\' to make it possible to check
|
/* set '\a' at the position of '\\' to make it possible to check
|
||||||
* for a line continuation in a single line comment (error 49)
|
* for a line continuation in a single line comment (error 49)
|
||||||
*/
|
*/
|
||||||
/* delete trailing whitespace before continuation */
|
|
||||||
*ptr++='\a';
|
*ptr++='\a';
|
||||||
*ptr='\0'; /* erase '\n' (and any trailing whitespace) */
|
*ptr='\0'; /* erase '\n' (and any trailing whitespace) */
|
||||||
} /* if */
|
} /* if */
|
||||||
@ -557,7 +554,7 @@ static void stripcom(unsigned char *line)
|
|||||||
} /* if */
|
} /* if */
|
||||||
} /* if */
|
} /* if */
|
||||||
if (*line == '\a') {
|
if (*line == '\a') {
|
||||||
*line = ' ';
|
memmove(line,line+1,strlen(line+1)+1);
|
||||||
}
|
}
|
||||||
} /* while */
|
} /* while */
|
||||||
#if !defined SC_LIGHT
|
#if !defined SC_LIGHT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user