Fix compile error with arrays of packed strings

This fixes the "possibly non-terminated string" error when declaring an
array of packed strings (unpacked strings worked OK).

Test code:

new x[][] = {
	!"hello",
	!"world"
};

main() {
	printf("%s", x[0]);
}
This commit is contained in:
Zeex 2013-12-27 02:31:43 +07:00
parent 99df013361
commit d9999d4da8

View File

@ -1868,7 +1868,7 @@ static const unsigned char *packedstring(const unsigned char *lptr,int *flags)
else
litadd(0); /* add full cell of zeros */
if (*lptr==',' || *lptr==')' || *lptr=='}' || *lptr==';')
if (*lptr==',' || *lptr==')' || *lptr=='}' || *lptr==';' || *lptr=='\n' || *lptr=='\r')
lptr=stringize; /* backtrack to end of last string for closing " */
return lptr;
}