(do_include): Correctly report the directive name

when any kind of include directive has no argument or null argument.

From-SVN: r3546
This commit is contained in:
Richard Stallman 1993-02-26 23:56:02 +00:00
parent ea3cfc819a
commit 33b039cc74
1 changed files with 9 additions and 5 deletions

View File

@ -3844,11 +3844,8 @@ get_filename:
default:
fail:
if (retried) {
if (importing)
error ("`#import' expects \"fname\" or <fname>");
else
error ("`#include' expects \"fname\" or <fname>");
return 0;
fend = fbeg;
break;
} else {
trybuf = expand_to_temp_buffer (buf, limit, 0, 0);
buf = (U_CHAR *) alloca (trybuf.bufp - trybuf.buf + 1);
@ -3875,6 +3872,13 @@ get_filename:
}
flen = fend - fbeg;
if (flen == 0)
{
error ("`#%s' expects \"fname\" or <fname>", keyword->name);
return 0;
}
/* Allocate this permanently, because it gets stored in the definitions
of macros. */
fname = (char *) xmalloc (max_include_len + flen + 2);