Commit 33b039cc by Richard Stallman

(do_include): Correctly report the directive name

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

From-SVN: r3546
parent ea3cfc81
...@@ -3844,11 +3844,8 @@ get_filename: ...@@ -3844,11 +3844,8 @@ get_filename:
default: default:
fail: fail:
if (retried) { if (retried) {
if (importing) fend = fbeg;
error ("`#import' expects \"fname\" or <fname>"); break;
else
error ("`#include' expects \"fname\" or <fname>");
return 0;
} else { } else {
trybuf = expand_to_temp_buffer (buf, limit, 0, 0); trybuf = expand_to_temp_buffer (buf, limit, 0, 0);
buf = (U_CHAR *) alloca (trybuf.bufp - trybuf.buf + 1); buf = (U_CHAR *) alloca (trybuf.bufp - trybuf.buf + 1);
...@@ -3875,6 +3872,13 @@ get_filename: ...@@ -3875,6 +3872,13 @@ get_filename:
} }
flen = fend - fbeg; 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 /* Allocate this permanently, because it gets stored in the definitions
of macros. */ of macros. */
fname = (char *) xmalloc (max_include_len + flen + 2); fname = (char *) xmalloc (max_include_len + flen + 2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment