mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-24 16:35:40 +08:00
nasm.c: better handling of errors without a file without ERR_NOFILE
We have hardcoded ERR_NOFILE in a number of places which really should not need them, and it represents loss of information. Instead, be robust in the handling either of no filename or no line number. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
parent
29dff5a29e
commit
883985def5
@ -1635,11 +1635,12 @@ static void nasm_verror_gnu(int severity, const char *fmt, va_list ap)
|
||||
src_get(&lineno, ¤tfile);
|
||||
|
||||
if (!skip_this_pass(severity)) {
|
||||
if (currentfile) {
|
||||
fprintf(error_file, "%s:%"PRId32": ", currentfile, lineno);
|
||||
} else {
|
||||
if (!currentfile)
|
||||
fputs("nasm: ", error_file);
|
||||
}
|
||||
else if (!lineno)
|
||||
fprintf(error_file, "%s: ", currentfile);
|
||||
else
|
||||
fprintf(error_file, "%s:%"PRId32": ", currentfile, lineno);
|
||||
}
|
||||
|
||||
nasm_verror_common(severity, fmt, ap);
|
||||
|
Loading…
Reference in New Issue
Block a user