\n in error msgs

This commit is contained in:
James Cherry 2020-12-24 15:55:10 -08:00
parent 704b8822a2
commit 0137916b85
2 changed files with 6 additions and 6 deletions

View File

@ -113,7 +113,7 @@ EOL \r?\n
"include_file"[ \t]*"(".+")"[ \t]*";"? {
#ifdef INCLUDE_SUPPORTED
if (sta::libertyInInclude())
sta::libertyParseError("nested include_file's are not supported\n");
sta::libertyParseError("nested include_file's are not supported");
else {
char *filename = &yytext[strlen("include_file")];
/* Skip blanks between include_file and '('. */
@ -126,7 +126,7 @@ EOL \r?\n
filename++;
char *filename_end = strpbrk(filename, ")");
if (filename_end == NULL)
sta::libertyParseError("include_file missing ')'\n");
sta::libertyParseError("include_file missing ')'");
else {
/* Trim trailing blanks. */
while (isspace(filename_end[-1]) && filename_end > filename)
@ -140,7 +140,7 @@ EOL \r?\n
}
}
#else
sta::libertyParseError("include_file is not supported.\n");
sta::libertyParseError("include_file is not supported.");
#endif
}

View File

@ -514,9 +514,7 @@ FILE *
libertyIncludeBegin(const char *filename)
{
FILE *stream = fopen(filename, "r" );
if (stream == nullptr)
libertyParseError("cannot open include file %s.", filename);
else {
if (stream) {
liberty_filename_prev = liberty_filename;
liberty_line_prev = liberty_line;
liberty_stream_prev = LibertyLex_in;
@ -524,6 +522,8 @@ libertyIncludeBegin(const char *filename)
liberty_filename = filename;
liberty_line = 1;
}
else
libertyParseError("cannot open include file %s.", filename);
return stream;
}