Make more RGBASM errors print their line number

Fixes #379.
This commit is contained in:
ISSOtm
2020-02-11 09:35:19 +01:00
parent 230f849229
commit 3b2c862320
3 changed files with 50 additions and 45 deletions

View File

@@ -396,7 +396,9 @@ void fstk_RunInclude(char *tzFileName)
oFailedOnMissingInclude = true;
return;
}
err(1, "Unable to open included file '%s'", tzFileName);
yyerror("Unable to open included file '%s': %s", tzFileName,
strerror(errno));
return;
}
pushcontext();
@@ -540,7 +542,8 @@ void fstk_Init(char *pFileName)
} else {
pCurrentFile = fopen(pFileName, "rb");
if (pCurrentFile == NULL)
err(1, "Unable to open file '%s'", pFileName);
yyerror("Unable to open file '%s': %s", pFileName,
strerror(errno));
}
nFileStackDepth = 0;