embryo: handle filename given to #line command

SVN revision: 62382
This commit is contained in:
Boris Faure 2011-08-12 12:39:29 +00:00
parent c76a60b0a5
commit ae4dd858bd
1 changed files with 16 additions and 0 deletions

View File

@ -942,6 +942,22 @@ command(void)
if (lex(&val, &str) != tNUMBER)
error(8); /* invalid/non-constant expression */
fline = (int)val;
while (*lptr == ' ' && *lptr != '\0')
lptr++; /* skip whitespace */
if (*lptr == '"')
{
char pathname[PATH_MAX];
lptr = getstring(pathname, sizeof pathname);
if (pathname[0] != '\0')
{
free(inpfname);
inpfname = strdup(pathname);
if (!inpfname)
error(103); /* insufficient memory */
} /* if */
}
} /* if */
check_empty(lptr);
break;