mirror of
https://github.com/cc65/cc65.git
synced 2024-12-23 04:30:10 +00:00
Use Line only if available
git-svn-id: svn://svn.cc65.org/cc65/trunk@3238 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
340a16e399
commit
19e1167b82
@ -76,7 +76,9 @@ static void IntWarning (const char* Filename, unsigned LineNo, const char* Msg,
|
||||
vfprintf (stderr, Msg, ap);
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
if (Line) {
|
||||
Print (stderr, 1, "Input: %.*s\n", SB_GetLen (Line), SB_GetConstBuf (Line));
|
||||
}
|
||||
++WarningCount;
|
||||
}
|
||||
}
|
||||
@ -112,7 +114,9 @@ static void IntError (const char* Filename, unsigned LineNo, const char* Msg, va
|
||||
vfprintf (stderr, Msg, ap);
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
if (Line) {
|
||||
Print (stderr, 1, "Input: %.*s\n", SB_GetLen (Line), SB_GetConstBuf (Line));
|
||||
}
|
||||
++ErrorCount;
|
||||
if (ErrorCount > 10) {
|
||||
Fatal ("Too many errors");
|
||||
@ -165,7 +169,9 @@ void Fatal (const char* Format, ...)
|
||||
va_end (ap);
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
if (Line) {
|
||||
Print (stderr, 1, "Input: %.*s\n", SB_GetLen (Line), SB_GetConstBuf (Line));
|
||||
}
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@ -192,7 +198,10 @@ void Internal (const char* Format, ...)
|
||||
va_start (ap, Format);
|
||||
vfprintf (stderr, Format, ap);
|
||||
va_end (ap);
|
||||
|
||||
if (Line) {
|
||||
fprintf (stderr, "\nInput: %.*s\n", SB_GetLen (Line), SB_GetConstBuf (Line));
|
||||
}
|
||||
|
||||
/* Use abort to create a core dump */
|
||||
abort ();
|
||||
|
Loading…
Reference in New Issue
Block a user